Active Directory - jrwhetse/jrwhetse.github.io GitHub Wiki

Active Directory

Query Examples

AD Query all users in MHV Users groups with attribute ObjectClass=user

ldapsearch -LLL  -H ldap://{ldaphost} -x  -D '{domain}\{username}' -W -E pr=1000/noprompt -b 'ou=Users,{oustring}' '(&(objectClass=user)(sAMAccountName=*))'

AD Query all groups and users of groups with attribute ObjectClass=group

ldapsearch -LLL  -H ldap://{ldaphost} -x  -D '{domain}\{username}' -W -E pr=1000/noprompt -b 'ou=Groups,{oustring}' '(&(objectClass=group)(sAMAccountName=*))'