我在asp.net中使用Windows身份验证在本地的每个东西都可以,但是当在同一个域的不同系统上部署时,它在此行中的工作获取错误SearchResult userObject = adSearcher.FindOne();
错误
system.runtime.interopservice.comException
我的代码是
WindowsIdentity winId = id as WindowsIdentity;
if (id == null)
{
Console.WriteLine("Identity is not a windows identity");
return;
}
string userInQuestion = winId.Name.Split('\\')[1];
string myDomain = winId.Name.Split('\\')[0];
DirectoryEntry entry = new DirectoryEntry("LDAP://" + myDomain);
DirectorySearcher adSearcher = new DirectorySearcher(entry);
adSearcher.SearchScope = SearchScope.Subtree;
adSearcher.Filter = "(&(objectClass=user)(samaccountname=" + userInQuestion + "))";
SearchResult userObject = adSearcher.FindOne();
StringBuilder data =new StringBuilder();
错误页面: link text
答案 0 :(得分:1)
从您的错误页面,它在目录Bind上失败。新计算机上的应用程序池是否有权查询AD?
答案 1 :(得分:0)
Dim Connection As New ADODB.Connection
Connection.Open(ConnectionString)
Dim Insname As String
Dim postname As String