My computer is on domain A, I am trying to get domain B by doing the following:
using System.DirectoryServices;
using System.DirectoryServices.ActiveDirectory;
.
.
.
DirectoryContext directoryContext = new DirectoryContext(DirectoryContextType.Domain, domainName, user, pass);
using (var domain = Domain.GetDomain(directoryContext))
{
...
}
When I do this Domain.GetDomain(directoryContext) throws an ActiveDirectoryObjectNotFoundException. My machine that I am running from is on a totally separate domain. The domain I am trying to connect to is a test domain. Is what I am trying to do possible? Is there some sort of network configuration that needs to be set to enable this?