|
|
|
date: Fri, 11 Jul 2008 00:14:37 -0700 (PDT),
group: microsoft.public.platformsdk.active.directory
back
Re: i need to get email id,group id in Direcotry Searcher
I'm sorry, but your English doesn't quite make sense.
If you want to retrieve the email address, the attribute is "mail". The
Windows account name is "sAMAccountName".
Group membership is much more complicated than that. You can look at
memberOf for a first approximation, but that does not include nested groups
or primary group.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
wrote in message
news:4e2884de-a05a-47c6-9e6d-7a69e0bb0caf@d77g2000hsb.googlegroups.com...
>i am unable to get email , group name is it such hectic but for geting
> name,account name ,cn..etc i am able to fetch
> please go through
> DirectorySearcher search = new DirectorySearcher(entry,
> "(&(objectCategory=person)(objectClass=user))");
>
> SortOption sort = new SortOption(property, SortDirection.Ascending);
> search.Sort = sort;
>
>
> foreach (SearchResult result in search.FindAll())
> {
>
> Console.WriteLine("Account name = {0}",
> result.Properties[property][0]);
> Console.WriteLine("user name = {0}",
> result.Properties["name"][0]);
>
> }
date: Fri, 11 Jul 2008 12:28:42 -0500
author: Joe Kaplan
|
|