Solved

Add smtp address to distribution list

Posted on 2014-03-18
3
3,789 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
Comment Utility
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
Comment Utility
thanks Pr0t0c0112 but does this work calling this from a file like I have above.
0
 

Author Comment

by:techdrive
Comment Utility
got it thanks for your help I really appreciate your help.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
how to add IIS SMTP to handle application/Scanner relays into office 365.

771 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

9 Experts available now in Live!

Get 1:1 Help Now