Active Directory凭据映射,如何以编程方式为给定系统映射活动目录帐户? [英] Active Directory Credential Mapping, how to map an active directory account programmatically for a given system?
问题描述
亲爱的大家,
我的系统的身份验证和授权取决于Active Directory。除了约束之外,系统对AD的性能很好。为了使系统在从未安装过系统的给定机器上正常工作,我必须在机器上手动映射活动目录服务器,例如,如果操作系统是Windows 7或更高版本,我必须进入控制面板中的Credential Manager并设置要登录的服务器名称和帐户。这必须按安装完成。我想避免这种情况。
谢谢
Dear everyone,
I have a system whose authentication and authorization depends on an Active Directory. The system does perform well with the AD except for just a constraint. For the system to work properly on a given machine where the system never been installed on I have to manually map the active directory server on the machine, for example if the OS is windows 7 or above I have to go into Credential Manager in control panel and set the server name and account to login to. This has to be done per installation. I want to avoid this situation.
Thanks
推荐答案
试试替换您的身份验证方法
Try replacing your Authentication method.
private bool Authenticate(string userName,
string password, string domain)
{
bool authentic = false;
try
{
DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,
userName, password);
object nativeObject = entry.NativeObject;
authentic = true;
}
catch (DirectoryServicesCOMException) { }
return authentic;
}
thund3rstruck撰写了一篇关于使用Active Directory的非常好的文章。
Howto :( Almost)Everything在Active Directory中通过C# [ ^ ]
这篇关于Active Directory凭据映射,如何以编程方式为给定系统映射活动目录帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!