Re: How to get ou of an user
dl
Date: 05/27/05
- Next message: [MSFT]: "RE: Quering PrincipalPermissionAttributes on class"
- Previous message: Ken Schaefer: "Re: ASP security"
- In reply to: Jan Peter Stotz: "Re: How to get ou of an user"
- Next in thread: Jan Peter Stotz: "Re: How to get ou of an user"
- Reply: Jan Peter Stotz: "Re: How to get ou of an user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 27 May 2005 15:34:38 +0800
Thanks Jan. But what is returned by the GetDirectoryEntry().Parent.Path?
can you give a sample format please?
TIA
"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: [MSFT]: "RE: Quering PrincipalPermissionAttributes on class"
- Previous message: Ken Schaefer: "Re: ASP security"
- In reply to: Jan Peter Stotz: "Re: How to get ou of an user"
- Next in thread: Jan Peter Stotz: "Re: How to get ou of an user"
- Reply: Jan Peter Stotz: "Re: How to get ou of an user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]