1

I am trying to retrieve the current domain object of the user. I am running into issues when the FQDN domain name is different than the Pre-Windows 2000 domain name (netbios).

String domainName = "????";    
Domain d = Domain.GetDomain(new DirectoryContext(DirectoryContextType.Domain, domainName)));

Exception thrown:

System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException: The specified domain does not exist or cannot be contacted.

I'm having trouble figuring out which domain name I should use to retrieve the current user Domain. My current implementation is using the FQDN string but that seems to be failing when the netbios is changed.

Any pointers to lead me in the correct direction? Thanks!

Hampton Terry
  • 344
  • 1
  • 13
  • An FQDN is never "????", it may be sth like "ab.c.de". Or did you try to use the NETBIOS domain name "????"? This would not work because the domain has to be given as FQDN when using GetDomain. It does not even work when the NETBIOS domain name is INTRA and the FQDN is intra.contoso.com. – Alexander Jan 14 '15 at 12:13
  • By "????" I meant I did not know what the value was suppose to be set to, thus my question. @Alexander – Hampton Terry Jan 16 '15 at 21:38

0 Answers0