|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
searching for a user in active directory by usernamethen find them in active directory and set the "User must change password at next login" attribut. I would like to limit it to a specific out and all sub OU under it. Im having issues nailing down the scope. I set the OU i want to start but it seems to go outside that OU and also not filtering the objectclass to just users. This is what i got so far. Also if i could get help checking that attribute to have them change there password too. Thanks. Imports System Imports System.DirectoryServices Namespace ActiveDirectorySearch Public Class ADSearch Shared Sub main(ByVal strUserName As String) Const strLDAP = "LDAP://ou=MINN Corporate,ou=CORP Users,dc=corp,dc=eschelon,dc=com" Dim DSESearcher As DirectorySearcher = New DirectorySearcher(strLDAP) DSESearcher.Filter = ("(objectClass=user)") Dim objResults As SearchResult For Each objResults In DSESearcher.FindAll() Console.WriteLine(objResults.GetDirectoryEntry.Path.ToString) Next End Sub End Class End Namespace any help would be great |
|||||||||||||||||||||||