Hello all,I have created a web page that allows me to add new users to active directory. at the moment all new users go to the default ou called users. I would like to create a drop down menu that allows me to choose what OU I want to place them into. How can I create this drop down list to show all the OU's in my domain?
Regards
Nav
How can I view OU's using adsi and asp
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- nav007_2000
- Posts: 3
- Last visit: Thu May 24, 2007 6:54 pm
- nav007_2000
- Posts: 3
- Last visit: Thu May 24, 2007 6:54 pm
How can I view OU's using adsi and asp
Hello all,I have created a web page that allows me to add new users to active directory. at the moment all new users go to the default ou called users. I would like to create a drop down menu that allows me to choose what OU I want to place them into. How can I create this drop down list to show all the OU's in my domain?
Regards
Nav
Regards
Nav
How can I view OU's using adsi and asp
There are a few ways to do that. I'm assuming you know how to create a drop-down list in HTML, and so what you're after is a way to retrieve all the OU names from the domain.
On the Essentials page of this site, you'll find a script that enumerates users and computers. Well, it also enumerates OUs. So, in the bit of the script that gets an OU name, you would just add the OU to your drop-down list.
On the Essentials page of this site, you'll find a script that enumerates users and computers. Well, it also enumerates OUs. So, in the bit of the script that gets an OU name, you would just add the OU to your drop-down list.
- nav007_2000
- Posts: 3
- Last visit: Thu May 24, 2007 6:54 pm
How can I view OU's using adsi and asp
Thanks for that. I will have a look at it.
I can create a static drop down list in HTML, how do I make it dynamic using the code below?
WorkWithObject oDomain
Sub DoObject_User(strName) 'your code goes here - strName 'is a user name. If you don't care 'about users, just leave this empty.End Sub
Sub DoObject_Computer(strName)
'your code goes here - strName 'is a computer name. If you don't care 'about computers, just leave this empty.End Sub
Sub WorkWithObject(oContainer) Dim oADObject For Each oADObject in oContainer Select Case oADObject.Class Case "user" 'oADObject represents a USER object; 'do something with it
DoObject_User oADObject.cn Case "computer" 'oADObject represents a COMPUTER object; 'do something with it DoObject_Computer oADObject.cn Case "organizationalUnit" , "container" 'oADObject is an OU or container... 'go through its objects WorkWithObject(oADObject) End select NextEnd Sub
I can create a static drop down list in HTML, how do I make it dynamic using the code below?
WorkWithObject oDomain
Sub DoObject_User(strName) 'your code goes here - strName 'is a user name. If you don't care 'about users, just leave this empty.End Sub
Sub DoObject_Computer(strName)
'your code goes here - strName 'is a computer name. If you don't care 'about computers, just leave this empty.End Sub
Sub WorkWithObject(oContainer) Dim oADObject For Each oADObject in oContainer Select Case oADObject.Class Case "user" 'oADObject represents a USER object; 'do something with it
DoObject_User oADObject.cn Case "computer" 'oADObject represents a COMPUTER object; 'do something with it DoObject_Computer oADObject.cn Case "organizationalUnit" , "container" 'oADObject is an OU or container... 'go through its objects WorkWithObject(oADObject) End select NextEnd Sub