I created a script to add a user in an Exchange Online distribution group. What this script does is :
- Connect to Exchange Online : You will be prompt for an admin credentials
- Verifying that your user is not in the distribution group
- If your user is not in the DG, he or she will be added to the DG
I've added some verbose log in order to know what the script is doing :)
How to use the script :
Add-UserToO365DistributionGroup.ps1 -DistributionGoupName "Marketing Team" -Member "email@example.com"