Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Here's a screenshot of my topology:

alt text

I'd like to use the dsadd command to add a user to Mercotel A> Administracion> Usuarios OU, but I can't figure out the syntax for nested OU's.

What would the command be?

dsadd user “cn=Sergio Tapia,ou=Mercotel A/Administracion/Usuarios,dc=aso,dc=com” -disabled no –pwd 123456 -mustchpwd no

This gives me an error.

share|improve this question
    
The path to that OU would be "OU=Usuarios,OU=Administracion,OU=Mercotel A,DC=aso,DC=com". –  Stemen Dec 6 '10 at 17:35
    
This might help: aprendeinformaticaconmigo.com/… –  l0c0b0x Dec 6 '10 at 17:38

1 Answer 1

up vote 5 down vote accepted

The user's DN should be:

"CN=Sergio Tapia,OU=Usuarios,OU=Administracion,OU=Mercotel A,DC=aso,DC=com"

Microsoft details the naming convention: "A DN is a sequence of relative distinguished names (RDN) connected by commas" in this MSDN article.

Full command:

dsadd user "CN=Sergio Tapia,OU=Usuarios,OU=Administracion,OU=Mercotel A,DC=aso,DC=com" -disabled no -pwd 123456 -mustchpwd no
share|improve this answer
    
When I run this, I get an error that says pwd is unrecognized parameter. dsadd user "CN=Sergio Tapia,OU=Usuarios,OU=Administracion,OU=Mercotel A,DC=aso,DC=com" -disabled no –pwd 123456 -mustchpwd no –  Sergio Tapia Dec 6 '10 at 17:44
    
@Sergio: I had copied your original code, looks like it containted a '–' instead of a '-' on the pwd attribute. I have updated my answer with the "correct" dash. :) –  jscott Dec 6 '10 at 17:50
    
There's TWO different dash symbols? :S –  Sergio Tapia Dec 6 '10 at 17:59
1  
@Sergio: There are many dashes. The wrong dash '–' is EN DASH, the correct dash '-' is HYPHEN-MINUS. Software as Office [and blogging software] will sometimes "prettify" dashes and quotes, incorrectly, to make the characters appear nicer on-screen. This can cause issues when copy/pasting code. –  jscott Dec 6 '10 at 18:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.