You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VB.NET WinForms应用LDAP报错‘Server is not operational’求助

VB.NET WinForms LDAP应用"Server is not operational"问题排查与解决请求

问题现象

  • 一款运行多年正常的VB.NET WinForms应用,通过LDAP获取用户基础信息,在域控制器变更后出现异常
  • 测试应用执行Clean Solution操作后,会触发"Server is not operational"报错,恢复清理掉的文件后可恢复正常
  • 正式发布应用后,用户会在1-2天内收到该报错,之后又自动恢复正常

环境与排查信息

  • 触发背景:新增部署两台域控制器(DC)并降级两台旧DC后,问题开始出现
  • LDP.exe可正常连接LDAP服务
  • Wireshark抓包结果:连接失败时仅发出"LDAP ping",无后续通信;连接成功时则正常建立SASL/GSSAPI连接

测试应用代码片段

Dim ident As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim username As String = ident.Name.Substring(ident.Name.IndexOf("\") + 1)
Dim protocol As String = "LDAP"
Dim path As String = "domain.com"
Dim sResult As SearchResult = Nothing
Dim ldapPath As String = If(String.IsNullOrEmpty(path), String.Format("{0}:", protocol), String.Format("{0}://{1}", protocol, path))
Using de As New DirectoryEntry(ldapPath)
    Try
        If de.Properties.Count > 0 Then
            Using adSearch As New DirectorySearcher(de)
                adSearch.Filter = String.Format("(&(objectClass=user)(sAMAccountName={0}))", username)
                sResult = adSearch.FindOne()
            End Using
        End If
    Catch ex As Exception
        Label1.Text = ex.Message
        
    End Try
End Using
Return sResult

已发现的相关情况

曾找到类似问题案例,仅通过重启操作解决,但未明确根本原因

请求

寻求该问题的根本原因及可行解决方案

内容的提问来源于stack exchange,提问作者SO User

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 10:15:31