Invalid DN Syntax when using VBScript to create user accounts

I have a VBScript that creates user accounts based on input from an Excel spreadsheet. I want the newly created accounts in Active Directory to be displayed in <last_name>, <first_name> format (please note, I am not talking about the displayName attribute). I configured the CN column in Excel in that format but I receive an error saying "An Invalid DN syntax has been specified." How do I configured the spreadsheet or the VB code to allow the user accounts in AD to be displayed in the desired format?
Who is Participating?
oBdAConnect With a Mentor Commented:
The comma is a reserved character in ldap; you need to escape it with a backslash, for example with a Replace(TheCN, ",", "\,")
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.