For some reason, ldap and directory services does not work when the computer is not joined to the domain. The error messages from .net is domain not available. Anyone know what needs to be done?
the basic…
domainAndUsername = domain + @"\" + username;
entry = new DirectoryEntry(_path, domainAndUsername, pwd);
entry.AuthenticationType = FindAuthTypeMicrosoft(authType);
… doesn’t seem to work when logged in locally to the machine when trying to supply testdomain.com to the code above.
Even though I can ping testdomain.com without an issue. What is different or the problem?
This code has worked for me in the past (though I admit I am not in a position to test it right now):
The hardest part (for me anyway) is figuring out the “connection string” details. I generally rely on ADSI Edit and AD Explorer to help me figure out what the correct values are. Softerra LDAP Browser – the free version is a bit older, v2.6 and tucked away in their download section.