Forum Discussion
Change O365 group email address using powershell
Using Set-Group seems to do the trick:
Set-Group "GroupName" -WindowsEmailAddress "NewPrimaryEmail@domain.com"
- Panagiotis KagiasJun 08, 2018Copper Contributor
Using Set-Group seems to do the trick:
Set-Group "GroupName" -WindowsEmailAddress "NewPrimaryEmail@domain.com"
This one worked for me. Many thanks !
- Dan K.Jun 08, 2018Copper Contributor
Just looking a little deeper, using Set-Group doesn't quite get it right when updating the primary SMTP domain. It seems to only update the exchange properties, and not AzureAD.
After using Set-Group, I waited awhile to ensure time for any propagation, and then checked the group objects in both EOL and AAD. While Exchange properties looked good, the AAD properties looked as if nothing had changed.
So, in the office admin portal list and get-msolgroup my test group is still showing the old domain, while the exchange properties and GAL correctly show the new domain.
Should we expect trouble down the road with a discrepancy like this?
- Dan K.Jun 06, 2018Copper Contributor
I tested updating a group's primary domain with Set-Group and, while it did update the primary email in exchange, it still shows with the old domain in lists. Using Get-MsolGroup, I can see that not all of the properties were updated on the AzureAD side of things. I'm hoping they will fix the problem with set-unifiedgroup soon, as I have a bunch of groups that were supposed to be transition to a new domain on Monday!
- Tim CreanJun 06, 2018Iron Contributor
I am also trying to add an email address and then update the new email address to be primarysmtp on a number of old O365 groups. I can add the new email address just fine, but get the "We failed to update the Unified Group" when I try to set the new address as PrimarySMTP.
Also, not sure if related to this issue, but Set-UnifiedGroup does no appear to be accepting a value for the -HiddenFromExchangeClientsEnabled parameter. If I try to set the parameter to $true, I get, "A positional parameter cannot be found that accepts argument 'True'."
'
From everything I have seen, I should be able to use that parameter so that certain groups will not appear/be discoverable in Outlook and Outlook on web clients.
- VasilMichevJun 06, 2018MVP
Nino_Bilic sorry, don't have a ticket number, was just relaying what the user posted on TechNet.
Tim Crean HiddenFromExchangeClientsEnabled is a SWITCH parameter, thus you have to use the following syntax (no space!):
Set-UnifiedGroup HiddenFromExchangeClientsEnabled:$false
- Rob HardmanJun 06, 2018Iron ContributorWorked for me too