Active directory 你能给我举个Active Directory的LDAP连接字符串的例子吗?

Active directory 你能给我举个Active Directory的LDAP连接字符串的例子吗?,active-directory,ldap,connection-string,Active Directory,Ldap,Connection String,contoso.com的LDAP连接字符串是什么 那test.contoso.com呢 谢谢 您需要广告放置位置的服务器名-然后语法如下- 对于Contoso.com LDAP://[ServerName]/dc=contoso,dc=com LDAP://[ServerName]/dc=test,/dc=contoso,dc=com 对于test.contoso.com LDAP://[ServerName]/dc=contoso,dc=com LDAP://[ServerName]/d

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

那test.contoso.com呢


谢谢

您需要广告放置位置的服务器名-然后语法如下-

对于Contoso.com

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

LDAP://[ServerName]/dc=contoso,dc=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";

用户名和密码呢?我需要在连接字符串本身中分配用户名和密码才能访问信息,对吗?此应用程序只是一个小测试,将在Windows XP上运行,并通过LAN连接到服务器。我不确定如何直接在字符串中添加用户名和密码。我提供了一个如何在c#中连接的示例。但不确定它是否对您有用:-)