我需要创建一个网页,对现有的Active Directory用户进行身份验证。域名实际上是一个云计算配置,其中有堆栈上的域控制器和多个其他服务器。
I need to create a web page that authenticates users against an existing active directory. The domain is actually a cloud computing configuration where there is a domain controller and multiple other servers on the stack.
据我所知,可用于从System.DirectoryServices命名空间的对象。不过,我似乎无法路径code到Active Directory通过LDAP://domain 地址。目前似乎没有任何的沟通正在进行。我怀疑有一些初始配置必要或安全措施阻止通信。
I understand that objects from the System.DirectoryServices namespace can be used. However, I cant seem to path the code to the active directory through the LDAP://domain address. There doesnt seem to be any communication going on. I suspect there is some initial configuration necessary or security measures blocking the communication.
我用这个例子从MSDN工作: msdn.microsoft/en-us/library/ms180890(v=vs.80).aspx 。
I am working with this example from MSDN: msdn.microsoft/en-us/library/ms180890(v=vs.80).aspx.
我得到一个错误,指出该服务器不可操作。
I get an error that says the server is not operational.
推荐答案看看这个链接(取代旧有web.archive):
Take a look at this link (replaced old one with web.archive):
HTTP://www.$c$cproject/KB/system/everythingInAD.aspx#35
这是如何得到默认项:
try { System.DirectoryServices.DirectoryEntry AdRootDSE = new System.DirectoryServices.DirectoryEntry("LDAP://rootDSE"); string rootdse = System.Convert.ToString(AdRootDSE.Properties["defaultNamingContext"].Value); if (!rootdse.StartsWith("LDAP://", StringComparison.OrdinalIgnoreCase) && !rootdse.StartsWith("LDAPS://", StringComparison.OrdinalIgnoreCase)) { rootdse = "LDAP://" + rootdse; } return rootdse; } catch (Exception ex) { }更多推荐
窗体身份验证对Active Directory
发布评论