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.

Display list of OUs


Question:

I would like to pull all OU's at a certain level so i can display them in an ITEMBOX. Does anyone know where I can begin?

Answer:

Here is a simple example. It may get you started.
AddExtender("wwads34i.dll")

; Search this ou and all objects below it.
sStarPath = "LDAP://myserver/ou=mytopou,dc=mysubdomain,dc=mydomain"

; objectCategory makes the search faster.
sFilter = "(&(objectCategory=organizationalunit)(ou=*))"

; Search
MyOuPaths = dsFindPath(sStarPath, sFilter)

OuExampleFormat=`WWWDLGED,6.1`

OuExampleCaption=`Organizational Unit Example`
OuExampleX=057
OuExampleY=094
OuExampleWidth=178
OuExampleHeight=126
OuExampleNumControls=003
OuExampleProcedure=`DEFAULT`
OuExampleFont=`DEFAULT`
OuExampleTextColor=`DEFAULT`
OuExampleBackground=`DEFAULT,DEFAULT`
OuExampleConfig=0

OuExample001=`069,105,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT`
OuExample002=`005,021,164,074,ITEMBOX,MyOuPaths,DEFAULT,DEFAULT,2,256,DEFAULT,DEFAULT,DEFAULT`
OuExample003=`005,011,074,008,STATICTEXT,DEFAULT,"My Organizatrional Units:",DEFAULT,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("OuExample")

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