469,648 Members | 1,201 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

How to return Domain Name for user account in AD?

I'm trying to write a component in VB.NET that takes a user account and
returns the Active Directory domain name of the user account. Since
it's not a windows/web application, I can't use
System.Security.Principal.WindowsIdentity.GetCurre nt.Name or
HttpContext.Current.User.Identity.Name to get the domain.

I found some examples that use the System.DirectoryServices namespace
and the DirectorySearcher to lookup user properties in AD (givenName,
mail, department, etc.), but it doesn't look the domain name is one of
the properties.

Any ideas/samples on how to get the domain name is appreciated.

Thanks,
Tim

Oct 6 '06 #1
0 1190

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Peter Steele | last post: by
4 posts views Thread by Tim Sapp | last post: by
8 posts views Thread by None | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.