exchange 2007: populating distribution group from csv
Import-Csv [path to csv] | ForEach {Add-DistributionGroupMember -Identity [dist group] -Member $_.PrimarySmtpAddress}
the csv would look like so:
PrimarySmtpAddress
user1@mydomain.com
user2@mydomain.com
…and so on…
when rerunning the powershell command above on an updated csv, it will display a quick error for entries that are already dist. group members and continue processing new additions. the above will not process member removals of course.
related powershell:
New-DistributionGroup -Name [dist group] -Type Distribution
Remove-DistributionGroup [dist group]
Add-DistributionGroupMember [dist group] -Member [user]
Set-DistributionGroup [dist group] -RequireSenderAuthenticationEnabled $False
Set-DistributionGroup -Identity [dist group] -ManagedBy [user]
Set-DistributionGroup [dist group] -EmailAddresses SMTP:user@mydomain.com
Get-DistributionGroupMember [dist group]
Get-DistributionGroupMember [dist group] | Export-Csv [path to csv]
info from:
http://o365info.com/manage-distribution-groups-by-using/
https://johnacook.wordpress.com/2010/04/19/add-users-to-a-distribution-group-from-a-csv-file-in-exchange-20072010-powershell/
https://exchangemaster.wordpress.com/2010/04/15/add-users-to-a-distribution-group-from-a-csv-file-in-exchange-20072010-powershell/
alternatively, outlook contact groups can be used instead of distribution groups. to import contacts from a csv in outlook go to File->Open->Import. a contact group can then be created based off of the imported contacts.