Forgive me if my understanding of this topic has some shortcomings, I only know what I know about domains and active directory because of what I've picked up from working with them.
There are two different "versions" of a domain name. The first is what I call the DNS domain name which would be like company.int (for the user [email protected]) and the second would be like prefixname (for the user prefixname\max) and they would both refer to the same thing.
My question is, given "company.int", how do I convert that to "prefixname"?
EDIT: Or given a System.DirectoryServices.ActiveDirectory.Domain object, how do I get the prefixname?
EDIT2: Also, is there a name for the "prefixname" other than that? I never know what to call it.
EDIT3: The value I'm trying to get is the same value that shows up on the windows login screen for "Log on to" (where it lists the domains and your computer).
EDIT4: I've figured out I can get the value by doing the following:
SecurityIdentifier sid = GetCurrentUserSID();
string prefixName = sid.Translate(typeof(NTAccount)).Value.Split('\\')[0];
Does anyone know of a better method to get this name?