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.

Create an OU in ADSI


Question:

What values do I use to create an OU in the adsi using : dsCreateObj() and dsSetObj()

Creating users and groups work OK (after studing some of the examples)

Manually I can create an OU without attibutes, but if a try in Winbatch I get an error :

"Requested attibute does not exist."

Answer:

Creating an ou is straight forward. It goes something like this:
sAdsiPath = "LDAP://muserver/cn=mycon,dc=subdomain,dc=mydomain"
sObjectClass = "organizationalUnit"
sOuName = "ou=myorgunit" 
sOuPath = dsCreateObj(sAdsiPath, sObjectClass,sOuName)
dsSetObj(sOuPath)
Have you tried this and are having a problem?

Some background stuff you may already know:
When an object is created in AD the service creates values for some properties automagically but other will need to be set after/before the object is created. Some object require that you set properties before you call dsSetObj because they have mandatory properties. In the case of OUs this is not necessary.


Article ID:   W15806
File Created: 2004:03:30:15:40:56
Last Updated: 2004:03:30:15:40:56