Invalid DN Syntax when using VBScript to create user accounts

Posted on 2008-11-07
Last Modified: 2012-05-05
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?
Question by:mcpp661
    1 Comment
    LVL 82

    Accepted Solution

    The comma is a reserved character in ldap; you need to escape it with a backslash, for example with a Replace(TheCN, ",", "\,")

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Companies that have implemented Microsoft’s Active Directory need to ensure that the Active Directory is configured and operating properly. If there are issues found and not resolved, it eventually leads the components to fail or stop working and fi…
    This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now