I am using the following code to connect to Active Directory programmatically.
public static void GetDirectoryEntry()
de = new DirectoryEntry();
de.Username = UserName;
de.Password = Password;
de.Path = "LDAP://server.abc.xyz.com:portno/OU=Users,DC=abc,DC=xyz,DC=com";
de.AuthenticationType = AuthenticationTypes.Secure;
But I get System.Runtime.InteropServices.COMException at de = new DirectoryService(); line. Also the code does not actually throw an exception and continues to execute but eventually the properties of de are null. What could be the reason ?
View Complete Post