0

I can to add a user in a Root-OU with dsadd command-line.But,I can't to add to in a Sub-OU. How can I add a user to a Sub-OU with dsadd command-line?

Here is my command-line.

dsadd user "cn=XXXX,ou=TEST,dc=mycompany,dc=com"  -upn XXXX@mycompany.com -fn XXXX -ln     YYYY 
-display XXXXYYYY -pwd 1234567 -desc "IT PERSONAL"  -mustchpwd yes 

Thanks in advance.

Cell-o
  • 327
  • 4
  • 15
  • 32

2 Answers2

1

Perhaps experiment with the PowerShell option, New-ADUser

New-ADUser GlenJohn -Type iNetOrgPerson -Path "DC=AppNC" -server lds.Fabrikam.com

Or

New-ADUser GlenJohn -OtherAttributes @{title="director";mail="glenjohn@fabrikam.com"}

it has a -Path parameter which allows you to set the parent OU like so:

 -Path "ou=mfg,dc=noam,dc=corp,dc=contoso,dc=com"
Jordan W.
  • 1,423
  • 1
  • 13
  • 20
0

Another nice tool using PowerShell is the Quest AD commandlets here. It lets you set the OU using -ParentContainer and has tons of other functionality as well.

new-qaduser -ParentContainer "ou=sales,dc=contoso,dc=com" -UserPrincipalName jimjim@contoso.com -FirstName Jim -LastName Jim
Christopher
  • 1,673
  • 12
  • 17