[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 83
  • 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 for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

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