Add users to a distribution group from a .csv file in exchange 2007\2010 Powershell


  1. First make a CSV with 1 column called “PrimarySmtpAddress” populate with all the SMTP address of the users your adding to the distro (example below)
  2. Copy to the system that the command will be run on.
  3. Now run the following command in Exchange 2007 Powershell

import-csv C:\Distro1.csv | foreach {add-distributiongroupmember -id Distro1-member $_.PrimarySmtpAddress }

  1. Highlighted locations need to be modified to match the file and group names as this is just an example.
  2. Note: you can get the members with the following

                Get-DistributionGroupMember Distro1.csv | Export-Csv C:\Distro1.csv

 

#TYPE Microsoft.Exchange.Data.Directory.Management.ReducedRecipient      
PrimarySmtpAddress      
2007user@domain.net      
2003user@domain.net      
2010user@domain.net      

 

 

To do this on a new group you can follow this article at exchangeteam.com

2 thoughts on “Add users to a distribution group from a .csv file in exchange 2007\2010 Powershell

Leave a comment