Monday , November 18 2019

Remove Distribution Groups from a list Contains in CSV file

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


Just get the CSV file in the Above format

Import-Csv C:\RemoveDG.csv

make sure CSV file is in the below format


Now Run

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


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 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

DNS Prerequisites for Cross Forest Migration

Lets see how to create a conditional Forwarder in Microsoft DNS and inflobox to Create ...

Leave a Reply

Your email address will not be published.