Forum Discussion
Change O365 group email address using powershell
Even though I logged in as a global administrator, I received the same error. It has been working fine but suddenly it didn't work.
# Info
- Date: 2018-06-01 to 2018-06-02
- Command: Set-UnifiedGroup -Identity "old@mydomain.com" -PrimarySmtpAddress "new@mydomain.com"
- Error Message:
We failed to update the unified group. Please try again later.+ CategoryInfo : NotSpecified: (:) [Set-UnifiedGroup], TaskException+ FullyQualifiedErrorId : [Server=HK0PR03MB3522,RequestId=66c8baa3-35be-40d9-8661-5db74747fa11,TimeStamp=6/2/2018 5:17:01 AM] [FailureCategory=Cmdlet-TaskException] 67671B94,Microsoft.Exchange.Management.RecipientTasks.SetUnifiedGroup+ PSComputerName : outlook.office365.com - Version (16.0.0.0)
- Name: Microsoft.Exchange.Management.ExoPowershellModule
# My Test
- Period: 2018-06-01 to 2018-06-02
- Console: PowerShell ISE, Visual Studio Code - PowerShell Integrated Console
- Tested with two users
- A global administrator
- My account : changed my account role to a global administrator
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 KOJun 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
- Dave ConradieJun 05, 2018Copper Contributor
I've just been trying this with Global Admin account and still getting "We failed to update the unified group. Please try again later."
Jason Paul Viola wrote:
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”}
.
Incredibly frustrating. - Rob HardmanJun 05, 2018Iron Contributor
Hi Jason,
I'm in the same position as Moonso Ko. In my case, attempting your workaround did alter the email addresses, but not the primary SMTP address for the group, and returned the error;
There is no primary SMTP address.
+ CategoryInfo : NotSpecified: (XXXXXXXX:ADObjectId) [Set-UnifiedGroup], DataValidationExcept
ion
+ FullyQualifiedErrorId : [Server=XXXXXX,RequestId=e54f49cd-6dd5-4309-9c96-a415efc1ced5,TimeStamp=6/5/2018
8:17:00 PM] [FailureCategory=Cmdlet-DataValidationException] 4FC61324,Microsoft.Exchange.Management.RecipientTasks
.SetUnifiedGroup
+ PSComputerName : outlook.office365.comHTH,
Rob