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.

link|improve this question

76% accept rate
what error are you getting? – Jordan W. Feb 15 '11 at 18:15
I'm not getting an error. – Cell-o Feb 15 '11 at 18:33
Any Suggestions? – Cell-o Feb 19 '11 at 17:52
What are the results of running the command you have above? Does it create the user in the root or in the test ou? – uSlackr Jun 17 '11 at 16:31
feedback

2 Answers

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"
link|improve this answer
First of all,thanks so much.But,How can I do with dsadd command-line? – Cell-o Feb 15 '11 at 17:36
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.