?
Solved

Add smtp address to distribution list

Posted on 2014-03-18
3
Medium Priority
?
6,378 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 2000 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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
If you have come across a situation where you need to find some EDB mailbox recovery techniques, then here you will find the same. In this article, we will take you through three techniques using which you will be able to perform EDB recovery. You …
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

850 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