Someone in the group – either an admin or service desk, may commit a mistake at some point and delete a distribution group or empty out the members' list. When that happens usually the recovery action is to restore a backup of the active directory. This script can be used to create brick-level backup of distribution groups, so that they can be restored individually.
Download
https://github.com/junecastillote/Export-GroupsAndMembers
Variables
Modify the variables as needed