Bulk add users to Distribution Group
I was ask recently to simplify a task for support staff to bulk add users to a distribution group. So i created the following script to add user from csv.
The script will ‘prompt’ for ‘Distribution Group’ name and will add users accordingly.
The script has the ‘WhatIf’ added by default you can remove it to apply the changes.
#Created to simplify daily tasks
$DGroup = Read-Host 'Insert Distribution Group Name'
Import-Csv 'C:\Softlib\Users.csv' |
Add-DistributionGroupMember -Identity $DGroup -Member $_.name -ErrorAction stop -WhatIf
Write-Host "$_.name" -ForegroundColor Red
Hope this helps someone out there in the wild wild net.