如何通过LDAP检索到的电子邮件地址findExchange Server名称?
我们的组织有一个BES服务器,我已经编写了一个代码来根据他们的交换电子邮件地址find用户,现在我想用C#.net通过他们的交换服务器名称(实例)来重定位它们。 我有一个与我的SQL Server数据库中的服务器名称表,但我不知道我应该如何处理它。 我已经开始了,但是我不知道应该如何继续。 你能帮我找出我的错误在哪里吗? 我的searchAd代码是这样的: private String SearchAd(string ID) { DirectoryEntry ldapObj; DirectorySearcher searchObj; SearchResult entryObj; DirectoryEntry entry; string strValue = "No Entry Found"; string strSearchFor; ldapObj = new DirectoryEntry(); ldapObj.Username = @"XYZ"; ldapObj.Password =System.Configuration.ConfigurationManager.AppSettings["XXX"].Trim(); ldapObj.Path = "LDAP://XYZ/dc=XX,dc=XX,dc=XX"; ldapObj.AuthenticationType = AuthenticationTypes.Secure; searchObj = new DirectorySearcher(ldapObj); searchObj.Filter = "(samaccountname=" + ID + ")"; searchObj.ReferralChasing = […]