2012-12-03 45 views
1

我用下面的下面的代碼在LDAP驗證用戶名和密碼:錯誤System.DirectoryServices.DirectoryServicesCOMException(0x8007203B):出現了一個本地錯誤

 bool authentic = false; 

     string ip_server = "10.53.41.21"; 
     string userName = "CN=test,N=Users,DC=user,DC=domain,DC=COM"; 
     string password = "something"; 
     try 
     { 
      DirectoryEntry entry = new DirectoryEntry("LDAP://" + ip_server, userName, password); 
      // entry. 
      object nativeObject = entry.NativeObject; 
      authentic = true; 
     } 
     catch (DirectoryServicesCOMException) { } 
     return authentic; 

據當地運行良好和IIS 6.0。

System.DirectoryServices.DirectoryServicesCOMException (0x8007203B): A local error has occurred. 

    at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) 
    at System.DirectoryServices.DirectoryEntry.Bind() 
    at System.DirectoryServices.DirectoryEntry.get_NativeObject() 

如何來解決這個問題:但是,當在IIS 7.0上運行出現錯誤?

謝謝!

回答

1

您傳遞distinguishedName屬性的用戶名,何時應該採用以下格式:domain\username

相關問題