[英]Active Directory LDAP connection using System.DirectoryServices - The server is not operational
I'm working on an application that uses some kind of single sign on with Active Directory.我正在开发一个使用 Active Directory 的某种单点登录的应用程序。
On my side, I'm trying to get some groups to see if the user is member of them.在我这边,我正在尝试让一些组来查看用户是否是其中的成员。
Sometimes, I get the following error:有时,我收到以下错误:
The server is not operational
服务器无法运行
The DirectoryEntry
object is created like this: DirectoryEntry
object 是这样创建的:
using(DirectoryEntry ldapConnection = new DirectoryEntry(ldapDomain))
{ Path = ldapPath, AuthenticationType = AuthenticationTypes.Secure }
where ldapDomain
is xycorp
and the ldapPath
is其中
ldapDomain
是xycorp
而ldapPath
是
LDAP://OU=someAppId,OU=someGroupName,OU=someClusterName,OU=someResourceName,DC=x,DC=y,DC=corp
After some analysis with the AD team we find out that the controller was removed from the xycorp
domain but for some reason the Domain Controller is still redirecting to it but the server is down.在与 AD 团队进行一些分析后,我们发现 controller 已从
xycorp
域中删除,但由于某种原因,域 Controller 仍在重定向到它,但服务器已关闭。 This generates the error message shown above.这会生成上面显示的错误消息。
My questions are:我的问题是:
DirectoryEntry
? DirectoryEntry
的构造有问题吗? Is it possible to request the "DC" parameters one at a time and to redirect outside the domain...? Thank you!谢谢!
This is something your administrators need to fix.这是您的管理员需要解决的问题。 It sounds like DNS is still advertising the DC that is down.
听起来 DNS 仍在宣传停机的 DC。 You can confirm this by typing this in the command line:
您可以通过在命令行中键入以下内容来确认这一点:
nslookup x.y.corp
The DNS lookup will show several IPs in a different order each time you do the lookup.每次进行查找时,DNS 查找都会以不同的顺序显示多个 IP。 Whichever one shows up first is the one that will be used.
无论哪个先出现,都会被使用。
If the IP address of the decommissioned DC still shows up in the list, then they need to fix that.如果退役 DC 的 IP 地址仍然显示在列表中,那么他们需要修复它。 Anything you do in code will just be a hack to get around something that shouldn't be happening in the first place.
您在代码中所做的任何事情都只是为了解决原本不应该发生的事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.