powershell - Active Directory computers not contain certain group -
i have audit whole active directory domain computers software. find out old admin deployed audit software group 'audit_software'. goal find computers in domain dont have 'audit_software' membership.
eg. 'audit_software' contain 2x computer accounts 'netbios_pc1' 'netbios_pc2'
but whole domain have many more computer accounts without group. how use powershell find computer accounts in ad (all containers) without 'audit_software' group ??
enumerate members of group this:
$group = get-adgroup -identity 'audit_software' $members = get-adgroupmember -identity $group | select -expand name
then enumerate computers , filter name not in list:
get-adcomputer -filter * | ? { $members -notcontains $_.name }
Comments
Post a Comment