简体   繁体   English

Active Directory LDAP 连接使用 System.DirectoryServices - 服务器无法运行

[英]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其中ldapDomainxycorpldapPath

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:我的问题是:

  • is there any possible retry mechanism or error handling on my side?我这边是否有任何可能的重试机制或错误处理? (The exception is indeed catch now but is thrown further) (异常现在确实被捕获,但被进一步抛出)
  • is there a way to tell the domain controller to not use the server anymore from backend code?有没有办法从后端代码告诉域 controller 不再使用服务器?
  • is there a problem with the construction of the DirectoryEntry ? DirectoryEntry的构造有问题吗? Is it possible to request the "DC" parameters one at a time and to redirect outside the domain...?是否可以一次请求一个“DC”参数并重定向到域外......?
  • is there any cache on my side for domain controllers?我这边有用于域控制器的缓存吗?

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.

相关问题 通过System.DirectoryServices将StartTLS与LDAP一起使用 - Using StartTLS with LDAP from System.DirectoryServices 使用C#System.DirectoryServices更新用户的登录时间(Windows 2008 Active Directory库) - Updating Logon Hours on a user using C# System.DirectoryServices (windows 2008 Active Directory library) 如何使用 System.DirectoryServices 在 Apache Directory Studio 上搜索 LDAP 用户数据? - How to do a search of LDAP user data on Apache Directory Studio with System.DirectoryServices? System.DirectoryServices ArgumentNull异常中的目录同步 - Directory Synchronization in System.DirectoryServices ArgumentNull Exception Active Directory:System.DirectoryServices命名空间。 得到“传递了无效的目录路径名” - Active Directory: System.DirectoryServices namespace. Getting “An invalid directory pathname was passed” System.DirectoryServices很慢? - System.DirectoryServices is slow? System.DirectoryServices很慢 - System.DirectoryServices is slow System.DirectoryServices的使用和限制 - System.DirectoryServices use And limitation 如何使用System.DirectoryServices访问不同域上的Web服务器 - How to Use System.DirectoryServices to Access a Web Server on a Different Domain 使用System.DirectoryServices更改密码时收到错误 - Receiving error in changing the password using System.DirectoryServices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM