remove particular email address from Bulk distribution Group

Hello Team,

We have exchange 2013, need to remove from Secondary address and uncheck the email address policy

this need to be done for bulk Distribution Groups, i have email address of those groups

Please suggest the script

Addy NadiaExpertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Addy NadiaExpertAuthor Commented:
now i only need to remove the from the distribution Group i have names of all distribution in CSV

please suggest command as per that.

script in artile looks very typical
AmitIT ArchitectCommented:
How many DL's you need to fix? If no too many, just do it manually.
Jason CrawfordTransport NinjaCommented:
The easiest way would be to create a .csv file containing two columns entitled Primary and Secondary.  List the PrimarySmtpAddress under the Primary column and the associated email address in the Secondary column.  Save the .csv file to your desktop as groups.csv and then run this script from EMS:

Import-Csv "$env:USERPROFILE\Desktop\groups.csv" | ForEach-Object {
  Set-DistributionGroup $_.primary -EmailAddresses @{remove="$_.secondary"} -EmailAddressPolicyEnabled $false

Open in new window

It would be wise to start with just one Distribution Group in the .csv file to gauge results and adjust as needed prior to running the entire batch.
Addy NadiaExpertAuthor Commented:
The first article helped me for my question..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.