How to add Distribution Group email alias from CSV in office 365


hello forum!

 

hope can me troubleshoot or let me know if not possible. but, used powershell import distribution groups , set primary emails in office 365. worked great, have 2 domains , add email alias dgs other domain.

 

this best attempt , not going well:

 

import-csv "c:\distributionlists.csv" | foreach {set-distributiongroup "$_.name" -emailaddresses smtp:$_.primarysmtpaddress,$secondarysmtpaddress}

 

$_.name column name dgs. ie: dl-it

$_.primarysmtpaddress column name primary email. ie: it@domain01.com

$_.secondarysmtpaddress column name email alias. ie: it@domain02.com

hi,

based on understanding, below code should work when manually run it:

set-distributiongroup "dl-accounting" -emailaddresses smtp:<primary email>,<alias email>

if distribution groups have been created, use set-distributiongroup command should work. how first new distribution group, , run foreach block loop.

regards,

yan li


cataleya li
technet community support



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group