I have list of the domains and groups, how to use ldapsearch to pull the sAMAccountName name and AccountIsDisabled associated with the groups? Thanks.
Hi,
This might need a little re-work to pipe in your list of groups, but something along these lines might get you going:
|ldapsearch domain=YourDomain search="(&(objectClass=user)(memberOf=CN=YourGroup,OU=YourOrgUnit,O=YourOrg))" | eval AccountIsDisabled=IF(userAccountControl=512,"True","False") | table sAMAccountName, AccountIsDisabled