Forum Discussion
Marvin Oco
Oct 02, 2019Iron Contributor
How do we bulk change Distribution List Primary SMTP from contoso.onmicrosoft.com to contoso.com
How do we bulk change 100 Distribution List Primary SMTP from contoso.onmicrosoft.com to contoso.com via powershell?
DanielNiccoli
Oct 02, 2019Iron Contributor
Marvin Ocowith something like that:
Get-DistributionGroup | ? { $_.PrimarySmtpAddress -like "*@contoso.onmicrosoft.com"} | % { Set-DistributionGroup -PrimarySmtpAddress "$($_.PrimarySmtpAddress.Split('@')[0])@contoso.com" -WhatIf }
- Isaac_G77Oct 13, 2023Copper Contributor
It looks like it wants an identity argument passed to it...
PS > Get-DistributionGroup | ? { $_.PrimarySmtpAddress -like "*@autoreturn.com"} | % { Set-DistributionGroup -PrimarySmtpAddress "$($_.PrimarySmtpAddress.Split('@')[0])@autura.com" -WhatIf } cmdlet Set-DistributionGroup at command pipeline position 1 Supply values for the following parameters: Identity: