【发布时间】:2012-10-25 11:49:04
【问题描述】:
如何访问远程机器上的 Active Directory。 我在 Azure 中创建了一个安装了 AD 的 win server 2008 R2。主机名:MyVMachine,DNS:myapp.cloudapp.net。我可以通过笔记本电脑使用远程桌面连接访问机器。
我想针对该 AD 对用户进行身份验证。我应该使用 ContextType.Domain 还是 ContextType.Machine 以及 LDAP,如何构建它以联系该 AD?此代码位于我笔记本电脑的 WCF 服务应用程序中。以下方法不起作用:
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "LDAP://MyVMachine.testenv.local/ou=Users,dc=testenv,dc=local"))
{
// validate the credentials
bool b = pc.ValidateCredentials("Administrator", "password");
return true;
}
我想在这里验证用户管理员,我看到存在于 testenv.local 节点 i AD 机器的用户节点中。
使用此代码,我得到“无法联系服务器”。与 principalServerDownExceptioan。
我需要帮助。
谢谢大家
我在 Azure 中的 AD 机器:
【问题讨论】:
标签: authentication azure active-directory