Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a new mailing list in Exchange 2010 which would consist of about 50 external email addresses. I have the list of (external) email addresses in plain text format.

I have previously solved this task by manually creating an external contact for each email address and then adding those external contacts to a distribution group.

What would be the most efficient way to solve this task with Exchange 2010? Does EMS help here?

share|improve this question
  1. Make a CSV, c:\distro.csv with 1 column called "PrimarySmtpAddress"
  2. Make a distribution group called DistroGroup
  3. Add the contacts to the group with this code

PowerShell Code:

import-csv c:\distro.csv | foreach {
    $contact = New-MailContact -Name $_.PrimarySmtpAddress -ExternalEmailAddress $_.PrimarySmtpAddress -OrganizationalUnit "Vendors" 
    Add-DistributionGroupMember -id DistroGroup -member $contact


share|improve this answer
A positional parameter cannot be found that accepts argument ''. + CategoryInfo : InvalidArgument: (:) [Add-DistributionGroupMember], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Add-DistributionGroupMember – Henno Sep 30 '11 at 6:51
Need to apply SP1 first? – Henno Sep 30 '11 at 6:54
Sorry my code was bad. Edited code should work now. I forgot that you need to add the email address as a contact with New-MailContact first and then pass that variable to Add-DistributionGroupMember as shown in the code example. – phiz Oct 1 '11 at 8:12

You'll still be doing the same thing, but it's definitely a task that's made easier with a little powershell.

You can use New-MailContact to batch-create the mail-enabled contact object, then pass a list of those new objects to New-DistributionGroup as -members.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.