Solved

Add smtp address to distribution list

Posted on 2014-03-18
3
4,241 Views
Last Modified: 2014-03-19
Please help as I have a list of SMTP addresses and trying to add them to the distribution list by displayname. I have a input csv file with the following format.

Displayname    smtpaddress
finance              finance_east@contoso.local
finance              finance_newyork@contoso.local
accounting       acct_east@contoso.local
accounting       acct_newyork.local

here is what I have been playing around with but still does not work please help.

Import-CSV C:\temp\emailbook.csv | % {
Set-distributiongroup $_.displayname -EmailAddresses SMTP:$_.email
}
0
Comment
Question by:techdrive
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
pr0t0c0l12 earned 500 total points
ID: 39936933
try using this:
Set-distributiongroup $_.displayname -EmailAddresses @{add=$_.email}

Open in new window

and this if you have multiple:
Set-distributiongroup $_.displayname -EmailAddresses @{add=$_.email,$_.email2}

Open in new window

0
 

Author Comment

by:techdrive
ID: 39937051
thanks Pr0t0c0112 but does this work calling this from a file like I have above.
0
 

Author Comment

by:techdrive
ID: 39940280
got it thanks for your help I really appreciate your help.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data‚Ķ
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates‚Ķ

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question