Solved

Add smtp address to distribution list

Posted on 2014-03-18
3
4,023 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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
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 Contact 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 Recipients >> Contact ta…
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now