Re: How to get ou of an user
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 05/25/05
- Next message: Reza: "ASP security"
- Previous message: Duane Laflotte: "Re: Problem decrypting data"
- In reply to: Jan Peter Stotz: "Re: How to get ou of an user"
- Next in thread: dl: "Re: How to get ou of an user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 25 May 2005 11:37:18 -0500
Yep, that works too. Thanks for pointing that out.
Joe K.
"Jan Peter Stotz" <jp_news@gmx.de> wrote in message
news:1o35o0xmyyeoe.1uwll7298ao41.dlg@40tude.net...
> dl schrieb:
>
>> Here is what I can think of
>> - authentication
>> - Search with SAMAccountName=<username entered>
>> - set PropertiesToLoad.Add("distinguishedName")
>> - parse the OU= string from the property returned
>
> Why parsing the dn when you can just ask the corresponding class?
>
> If you search the account by using the DirectorySearcher class, as result
> you will get an object of type SearchResult. Call on this object
> .GetDirectoryEntry().Parent.Path and you get what you want.
>
> Jan
- Next message: Reza: "ASP security"
- Previous message: Duane Laflotte: "Re: Problem decrypting data"
- In reply to: Jan Peter Stotz: "Re: How to get ou of an user"
- Next in thread: dl: "Re: How to get ou of an user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|