Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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,005 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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..
A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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

705 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