开发者

Can PrincipalContext be used to get Active Directory information if computer is not domained joined

开发者 https://www.devze.com 2023-04-12 02:00 出处:网络
I am using PrincipalContext.I am receiving \"The LDAP server is unavailable.\"\"Cannot be reached\".I am developing from a machine that is not joined to the domain I want to query.Does开发者_如何学Go

I am using PrincipalContext. I am receiving "The LDAP server is unavailable." "Cannot be reached". I am developing from a machine that is not joined to the domain I want to query. Does开发者_如何学Go this matter? Do I need to pass admin creds to connect to AD, so I can query or search it?

My code resembles this: http://www.codeproject.com/KB/system/usingAccountManagement.aspx


It does matter. But you can get your site access by setting an <identity> tag in web.config to a user with ldap reading privileges:

<system.web>
<identity userName="DOMAIN\ldapUser" password="ldapPW"/>
</system.web>

here's a msdn

0

精彩评论

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

关注公众号