0

I managed to set up an windows 2003 Active Directory for SSL, both StartTLS and LDAPS, this I have verified using the Ldp.exe from Windows Resource Toolkit. I am also able to query the contents of the directory using LdapConnection object in C# .NET.

I would like to proceed to use SSL for my Active Directory queries, for example:

Domain.GetDomain

I have tried using

domain = Domain.GetDomain(new DirectoryContext(DirectoryContextType.DirectoryServer, mydomain + ":636", username, password));

But it seems to not be talking LDAPS to the port 636, I get the following Exception

System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException: Domain controller "ad.rambutan.com:636" does not exist or cannot be contacted.

The same goes for Forest.GetForest.

Is there a way to get Domain.GetDomain to work over SSL? Either StartTLS or LDAPS would be fine.

4

2 回答 2

0

您似乎无法使用 Domain.GetDomain 执行此操作,但您可以通过将AuthenticationType属性设置为SecureSocketsLayer来使用DirectoryEntry类执行此操作。有关示例,请参阅DirectorySearcher not working for Windows 7 64 bit or 32 bit over network

于 2012-09-20T12:45:14.883 回答
0

DirectoryContextType的文档没有提到 LDAPS,所以我认为您不能使用它。

于 2012-09-20T12:36:56.850 回答