2013-01-10 70 views
0

我使用的代码块下面让LDAP用户名(我只给第一线)获取LDAP用户名无效过滤

using (PrincipalContext context = new PrincipalContext(ContextType.Domain)) 
{ 

} 

一次我发布asp.net MVC应用服务器它给了我一个错误。

ArgumentException的:将(&(objectCategory =用户)(objectClass的=用户)(|(的UserPrincipalName =)(的distinguishedName =)(名称=)))搜索过滤器无效]

回答

1

尝试像这样传递域参数。

using(PrincipalContext pc = new PrincipalContext(ContextType.Domain, domain)) { 
     // validate the credentials 
     result = pc.ValidateCredentials(username, password); 
}