WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Error 1063 using dsObjCreate

Keywords: 	 error 1063 dsobjcreate

Question:

I'm trying to create a new user account in win2k AD. user will reside in a custom OU structure. my ADSIPATH looks like:
sAdsiPath = "LDAP://cn=ou3,ou=ou2,ou=ou1,dc=mydom,dc=com"
sObjectClass = "user"
sUserName = strcat("cn=",firstname," ",lastname)
sObjectPath = dsCreateObj( sAdsipath, sObjectClass, sUserName)
I have created a user in the default USERS folder but we want to organize our users and workstations by locationa and functional area

Some additional info....

If I simplify the sadsipath:

sadsipath = "LDAP://CN=users,DC=mydom,DC=com"
It works fine. I can add the user.

I still need help adding the user to a different OU Any ideas??

Answer:

Make sure you only refer to an organizational unit with the syntax "ou=". You can not access an ou by using "cn=". Also, you have multiple ou's in our path, this would only work if you have nested ou's.

Resolution:

I got it working.
  1. OUs should be listed from lowest level to highest level in sAdsiPath

  2. OU names are case sensitive

  3. users is not the same Users
When I fixed that, it started working. Thanx for your help
Article ID:   W15039
File Created: 2002:09:05:13:49:16
Last Updated: 2002:09:05:13:49:16