I got a request to list all distribution groups and their managers in a csv file. This way, you can quickly see which groups that do not have a manager 🙂
The script is simple, just run it from Exchange Management Shell, and supply the following parameters:
- File : required the csv file name and path to save the output csv
- OU : optional. used to narrow the scope of the script to a certain OU.
Get managers of all groups and export results to c:\files.csv”
PS C:\>Get-ExchangeDGManagers -file “c:\file.csv”
Get managers of all groups under the specified OU.
PS C:\>Get-ExchangeDGManagers -OU “ou=mailing groups, dc = contoso, dc=com” -file “c:\file.csv”
Download the script
You can find the script here: Get-ExchangeDistributionGroupManagers