Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

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

$
0
0

Hello Forum!

 

Hope someone can help me troubleshoot this or even let me know if its not possible. But, I used powershell to import distribution groups and set primary emails in Office 365. That worked great, but we have two domains and i would like to add an email alias to all my DGs for the other domain.

 

This was my best attempt and its not going well:

 

Import-CSV "C:\distributionlists.csv" | foreach {Set-DistributionGroup "$_.Name" -EmailAddresses SMTP:$_.PrimarySmtpAddress,$SecondarySmtpAddress}

 

$_.Name is the column name for my DGs. IE: DL-IT

$_.PrimarySmtpAddress is the column name for my primary email. IE: IT@domain01.com

$_.SecondarySmtpAddress is the column name for my email alias. IE: IT@domain02.com


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>