Forum Discussion
Hasan Siddiqui
Nov 30, 2017Copper Contributor
Change O365 group email address using powershell
I am trying to change primarty SMTP of Office365 group but getting error:
We failed to update the unified group. Please try again later. + CategoryInfo : NotSpecified: (:) [Set-UnifiedGroup],...
Jason Paul Viola
Jun 05, 2018Copper Contributor
Hi MOONSO KO,
You can try the following cmdlet to update the primary SMTP address of the O365 group.
Set-UnifiedGroup -Identity old@mydomain.com -EmailAddress @{remove=”SMTP:old@mydomain.com”;add=”SMTP:new@mydomain.com”,”smtp:old@mydomain.com”}
This should update the primary SMTP address to the new@mydomain.com and set the old@mydomain.com to a secondary SMTP address.
You can try the following cmdlet to update the primary SMTP address of the O365 group.
Set-UnifiedGroup -Identity old@mydomain.com -EmailAddress @{remove=”SMTP:old@mydomain.com”;add=”SMTP:new@mydomain.com”,”smtp:old@mydomain.com”}
This should update the primary SMTP address to the new@mydomain.com and set the old@mydomain.com to a secondary SMTP address.
MOONSO KO
Jun 06, 2018Copper Contributor
Hi Jason,
Thank you for your update. I tried your script but it didn't work.
# Error Message
There is no primary SMTP address.
+ CategoryInfo : NotSpecified: (Old:ADObjectId) [Set-UnifiedGroup], DataValidationException
+ FullyQualifiedErrorId : [Server=XXXXXX,RequestId=c0385b6c-f9d6-45af-8c1d-b3ec9d1aab74,TimeStamp=6/6/2018 2:24:31 AM] [FailureCategory=Cmdlet-DataValidationExcept
ion] 4F3E44A4,Microsoft.Exchange.Management.RecipientTasks.SetUnifiedGroup
+ PSComputerName : outlook.office365.com
- MOONSO KOJun 06, 2018Copper Contributor
I opened a ticket for this and a MS engineer tested some and now he is looking into the transcript.
# MS Diagnose
- Start-Transcript
- Add new email and test address: OK
- Set-UnifiedGroup -Identity "Old Group" -EmailAddresses: @{Add ="new@abc.com"}
- Set-UnifiedGroup -Identity "Old Group" -EmailAddresses: @{Add ="test@abc.com"}
- Remove old email address: Error
- Set-UnifiedGroup -Identity "Old Group" -EmailAddresses: @{Remove="old@abc.com"}
- Error: There is no primary SMTP address
- Set SMTP email address (new, test): Error
- Set-UnifiedGroup -Identity "Old Group" -EmailAddress SMTP:"new@abc.com"
- Error: We failed to update the unified group. Please try again later
- Set primary smtp address by using a pipe (new, test)
- Get-UnifiedGroup -identity "Old Group" | Set-UnifiedGroup -PrimarySmtpAddress new@abc.com
- Error: We failed to update the unified group. Please try again later
- Collect the exception message
Microsoft.Exchange.Configuration.Tasks.TaskException: We failed to update the unified group. Please try again later. at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object target, String helpUrl) at Microsoft.Exchange.Configuration.Tasks.Task.WriteError(Exception exception, ErrorCategory category, Object target, Boolean reThrow) at Microsoft.Exchange.Configuration.Tasks.Task.WriteError(LocalizedException exception, ExchangeErrorCategory category, Object target)
... - Stop-Transcript