There gotta be an easy way to do this, I can\'t believe there\'s none. I have scanned through net and found, like, 20 different methods to find in which domain current user is,
System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain() wraps DsGetDcName which will search the network for a domain controller even if the machine is not part of a domain. (see remarks)
As alternative to NetGetJoinInformation you could use GetComputerNameEx with the COMPUTER_NAME_FORMAT.ComputerNameDnsDomain
flag to get the full DNS domain name.
(If not part of a domain, it still returns true, but the resulting string will be empty.)