你能给我一些Active Directory的LDAP连接字符串示例吗?

时间:2011-03-22 18:58:30

标签: active-directory ldap connection-string

contoso.com的LDAP连接字符串是什么?

test.contoso.com怎么样?

谢谢!

1 个答案:

答案 0 :(得分:7)

您需要放置AD的服务器名称 - 然后语法将如下所示 -

对于Contoso.com

LDAP://[ServerName]/dc=contoso,dc=com

对于test.contoso.com

LDAP://[ServerName]/dc=test,/dc=contoso,dc=com

我不知道它是否对您有用,但这是一个在C#应用程序中连接的示例

    DirectoryEntry de = new DirectoryEntry("LDAP://[ServerName]/dc=test,/dc=contoso,dc=com");
    de.Username = "username";
    de.Password = "password";