Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DirectoryServices - “Network logon failure unknown user name or bad password”
- //Example 1: Find all users in Active Directory. Be sure your LDAP connection string is correct.
- string ldapConnection = @"LDAP://sergio-j9i2vccv/dc=contoso,dc=com";
- string username = "Administrador"; //I'm using a spanish version of WS2003.
- string password = String.Empty;
- UserFinder userSearcher = new UserFinder(ldapConnection, username, password);
- try
- {
- var users = userSearcher.FindAllUsers();
- foreach (var user in users)
- {
- Console.WriteLine(user.Name);
- Console.WriteLine(user.Path);
- }
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
Add Comment
Please, Sign In to add comment