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