We help IT Professionals succeed at work.
Get Started

How to use the dsadd utility to add a user when there is a comma in the CN-part of the DN

SirOracle_ asked
Last Modified: 2008-01-09
I am trying to update the Active Directory in our testlab with the production Active Directory. I hva chosen to use some batch-scripts with dsquery, dsget, dsadd and dsmod to do this.

But our users are in the form "Firstname, Lastname". For instance, a user with first name "Tom" and last name "Olsen" will come out like this from dsquery: "CN=Olsen\, Tom,OU=MyDepartment,DC=MyDomain,DC=com". But the dsadd utility don't like this:
C:\dsadd user "CN=Olsen\, Tom,OU=MyDepartment,DC=MyDomain,DC=com"
dsadd failed:CN=Olsen\, Tom,OU=MyDepartment,DC=MyDomain,DC=com:The name provided is not a properly formed account name.

I have tried to remove the escape-character (the backslash), but that dosn't help. And thats understandable, since it uses a comma to seperate the DN-parts.

Does anyone know how to accomplish this?
Watch Question
Principal Consultant
Most Valuable Expert 2016
Top Expert 2014
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE