开发者

What's the connection string for LDAP?

开发者 https://www.devze.com 2023-02-18 21:06 出处:网络
Here how I need to use it: string tmpDirectory = String.Format(\"LDAP://ou={0},dc={1},dc={2}\", parentOrganizationUnit,

Here how I need to use it:

string tmpDirectory = String.Format("LDAP://ou={0},dc={1},dc={2}", 
                                    parentOrganizationUnit,
                                    domainName,
                                    domainExtension
);

When I try to run some code using this connection, I get an exception. (See this question for more information).

I've been told I need to provide the connection string with credentials - a username and a password.

What's the connection string like? 开发者_运维问答I need the exact syntax. :) Thanks!

I'm using Windows Server 2003 and Active Directory.


The credentials don't go into the connection string, but are separate parameters on another overload of the DirectoryEntry constructor:

var entry = new DirectoryEntry(tmpDirectory, "username", "password");
0

精彩评论

暂无评论...
验证码 换一张
取 消