[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 69
  • Last Modified:

Adding bulk SMTP addresses to distribution group in Exchange

Hi Folks,

I'm trying to bulk add a group of SMTP addresses to a distribution group.  The CSV content is such:

user1@systems.com,user2@systems.com,user3@systems.com

Import-CSV D:\Scripts\Test\dist-list.csv | ForEach {Add-DistributionGroupMember -Identity "ALLKSATestStaff" -Member $_}

Open in new window


When I run this through the Exchange Management Shell, it executes without any errors, but the distribution group is not updated - any ideas?

Thanks in advance
0
khanfe
Asked:
khanfe
2 Solutions
 
Michael PfisterCommented:
Import-CSV expects each entry in a seperate line.


i.e.


user1@systems.com
user2@systems.com
user3@systems.com
0
 
FOXActive Directory/Exchange EngineerCommented:
name the header that contains your email addresses Alias
Import-CSV "D:\Scripts\Test\dist-list.csv" | ForEach {Add-DistributionGroupMember -Identity "ALLKSATestStaff" -Member $_.Alias}
0
 
khanfeAuthor Commented:
Thanks folks - Both your suggestions worked for the different issues - it's now working!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now