Powershell: Get list of users not in specific Active Directory Group

Had a requirement to quickly identify all users not in our USB_lockdown Group – easy enough with this handy little method of identifying users not in a specific AD Group through Powershell:

$MyGroup = (Get-ADGroup 'AD_GROUP_NAME').DistinguishedName
Get-ADUser -Filter { -not (memberof -eq $MyGroup) } | Out-GridView

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.