PowerShell Find Empty AD Groups


Before you can use the Active Directory Cmdlets you will either need the to install the RSAT tools or run the below PowerShell on on Domain Controller. You can read more about  Active Directory Administration with Windows PowerShell here https://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx

The Script

Amend the Export-Csv path as required.

Import-Module activedirectory
Get-ADGroup -Filter * -Properties Members | Where {-not $_.members} | select Name | Export-Csv D:\EmptyADGroups.csv –NoTypeInformation

Alternative VBS Method

If you would prefer to use VBS take a look at the below link for an alternative method.

Leave a Comment

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