powershell script to create AD user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 05:18 AM
Hi Guys,
I have used the following powershell command to create AD user:
New-ADUser -Name "XXX" -GivenName xxx -Surname xxx -SamAccountName XXXXXXX -UserPrincipalName xxxx@example.com -path "OU=XYZ, DC=example, DC=com"
But when running this script i am getting followinf error message:
"errorMessages": "The term 'New-ADUser' is not recognized as the name of a cmdlet, function, script file, or operable program.
So can someone please suggest on this.
Thanks,
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 05:28 AM
Hi Sri,
Is the active directory package enabled on the mid server which you are using to run powershell.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 06:09 AM
Hi Ankur,
Thansks now i am not getting this error message.But it could not create user in AD even after successfully running this command.
Can you please help on this?
Thanks,
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 06:43 AM
Hi Sri,
So what is the error message you are getting?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 06:59 AM
Hi Ankur
I am not getting any error message.
Script status is successful but the user what i am trying to create is not happening in our AD.
Thanks,
Sri