Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Active Directory and VB.Net - populating a dropdown list with specific OU's from a domain?

Posted on 2009-05-19
1
Medium Priority
?
1,011 Views
Last Modified: 2013-11-26
I need to populate a dropdownlist with all OU's in a specific domain.  Then when a user selects the OU, it will display another dropdownlist with the groups from that OU.  The user then can add or remove users from the selected group/groups.  Any code examples or pont me to the right direction where and how I can do this using VS 2008 as a web form?
0
Comment
Question by:kouts1
1 Comment
 
LVL 23

Accepted Solution

by:
debuggerau earned 2000 total points
ID: 24428191
this should get you started, however VS2008 questions are better in the appropriate section.
create a file like ListOUs.vbs and insert the following code:

Set objOU = GetObject("LDAP://ou=<Your OU Group>,dc=<your domain>,dc=com")
objOU.Filter = Array("organizationalUnit")
strList = "Select an Organizational Unit:"
For Each objChild In objOU
    strList = strList & vbCrLf & objChild.ou
Next
strSelect = InputBox(strList, "MyProgram")
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question