AD Powershell help

Soldato
Joined
14 Mar 2004
Posts
8,040
Location
Brit in the USA
So I made a new OU in Active Directory and now I need to add users to it in Powershell. I'm a Powershell noob and am very confused. I assume I need to use the New-ADuser cmdlet? How do I specify which OU I want to add the user to?
Thanks!
 
Thanks, guys.

Got a bit further, but now I'm getting an error. Here is the command I'm using (I know I would normally use a script or tool for this, but I'd like to get it working purely from the command line right now)

new-ADUser -Name "Bob Smith" -SamAccountName "bsmith" - GivenName "Bob" -SurName "Smith" -path 'OU=NameOfOU, DC=NameOfDomain, dc=local' -Enabled $true -AccountPassword (Read-Host -AsSecureString "Type password here:") -ChangePasswordAtLogon $true

It asks for the password, then I get "The server is unwilling to process the request"

Any ideas?

Thanks again!

EDIT: LOL - always the way..post this and then find the answer 1 minute later :D should have been dc=com instead of dc=local.
 
Last edited:
Back
Top Bottom