A friend of mine asked how he could read from his local AD, in order to create a script for verifying group membership against a saved list. Here is a small piece of code that helped him:
$users = [adsi]"LDAP://cn=groupName,ou=ouName,dc=MyDomain,dc=MyDomain2"
foreach ($user in $users.Member) {
Write-Host (([adsi]"LDAP://$user").displayname)
}
Monday, April 14, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment