Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Directory (ADSI, AD) OU tree issue

Status
Not open for further replies.

mpemberton

Programmer
Mar 5, 2002
37
US
Here's what I've got in AD:
Domain -> OU1 -> OU2 -> Users

When I authenticate a user, I get the "distinguishedname" property back with "CN=username,OU=OU2,OU=OU1,DC=Domain,DC=com". Here's what I want.

1) Is there any way I can parse out (easily) what is the lowest OU for this user (which would be OU2 in this instance)?

2) To follow up question 1, does the distinguishedname property provide the info in the correct reverse order (assuming I might have to parse it myself)?

3) Is there another way to retrieve the lowest OU for the authenticated user?

Thanks for anyone's help with this. I've tried to resolve this for several days, and don't have any hair left....

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top