Saturday , September 21 2019

Remove Distribution Groups from a list Contains in CSV file

Got a small request on removing multiple Distribution groups from a csv file

image

Just get the CSV file in the Above format

Import-Csv C:\RemoveDG.csv

make sure CSV file is in the below format

image

Now Run

Import-csv C:\RemoveDG.csv | foreach{Remove-distributiongroup $_.RemoveDG}

image

It removes the Distribution groups containing in the CSV file

Use -Confirm Switch if you want to avoid prompts

To Disable Distribution Groups from a list Contains in CSV file

Import-csv C:\RemoveDG.csv | foreach{Disable-distributiongroup $_.RemoveDG}

Thank you

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Save Public IPs using F5 LTM Policies

F5 has different modules and one of them is LTM – Local Traffic Manager . ...

Leave a Reply

Your email address will not be published.