Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with ADSI connection 1

Status
Not open for further replies.

alepore

MIS
Jun 25, 2001
27
US
I am new to scripting and hope this is an easy problem to fix. I try to connect to a user object in AD Users and Computers and I get this error....
"An invalid dn syntax has been specified" on Line 2 with Code: 80072032.

Here is the code:

Set objUser = GetObject("LDAP://CN=\\User,Joe,OU=test,DC=domain,DC=com")
objUser.Put "description", "This is a test1"
objUser.SetInfo

It works great if the CN is equal to one word like TestAccount. All of our user's CN are LastName, FirstName. When I ran a csvde.exe to export AD info, the CN are shown as "LastName\\, FirstName".

Any help will be appreciated.
Thanks.

 
The code I was using is actually

Set objUser = GetObject("LDAP://CN=User\\,Joe,OU=test,DC=domain,DC=com")
objUser.Put "description", "This is a test1"
objUser.SetInfo
 
Hello alepore,

Try instead, if it is simply to escape a comma:
Code:
    Set objUser = GetObject("LDAP://CN=User\,Joe,OU=test,DC=domain,DC=com")
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top