OK, so apparently this is a known issue, MS is looking into a fix.
Powershell Connect AppOnly to EXO - Anyone able to use command set-unifiedgroup

We want to use App-Only authentication in a script to change M365-Unified Group PrimarySMTPAddress and Alias
i can connect with App-Only Auth as described here App-only authentication | Microsoft Learn and use Get-Unifiedgroup or even use set-mailbox to change EMailAddresses. But if i try to use set-unifiedgroup command it will always fail with following error:
We failed to update the unified group. Please try again later.
+ CategoryInfo : NotSpecified: (:) [Set-UnifiedGroup], TaskException
+ FullyQualifiedErrorId : [Server=GV0P278MB0001,RequestId=00e66d64-0be9-49c3-92a1-44147c1d08fd,TimeStamp=17/12/2020 08:36:05] [FailureCategory=Cmdlet-TaskException] 74BF6179,Microsoft.Exchange.Management.RecipientTasks.SetUnifiedGroup
+ PSComputerName : outlook.office365.com
as support suggested, i have even added the App to the Global Admin Role and wait 24hours - still same error.
When i connect as User same Command works perfectly fine - so it can't be the command which would be for example:
Get-UnifiedGroup testgrpid|set-unifiedgroup -Alias myNewAlias
So my simple question - does it work for anyone out there?
I have a ticket with ms got kind of stuck - so any help welcome.
I'm using Powershell Module ExchangeOnlineManagement v 2.0.3 but have tryed 2.0.4 Preview as well -same behavior.
-
Vasil Michev 66,011 Reputation points MVP
2020-12-18T11:00:07.79+00:00 4 additional answers
Sort by: Most helpful
-
Vasil Michev 66,011 Reputation points MVP
2020-12-18T10:20:46.373+00:00 Seems to be broken here as well, let me ping few folks.
Chase, Mark 21 Reputation points2020-12-18T21:15:30.49+00:00 I am also having this issue. I have to "explain to the boss" so to speak, so if there is an official MS ticket for this, I can definitely use that. Do you have a ticket/case number?
And I also get an error creating a group:
The group can't be created
- CategoryInfo : NotSpecified: (:) [New-UnifiedGroup], TaskException
- FullyQualifiedErrorId : [Server=BN8PR19MB2657,RequestId=de05ce51-1cea-474b-b1d8-473705752be5,TimeStamp=12/18/2020 9:16:43 PM] [FailureCategory=Cmdlet-TaskException] A6A07FF9,Microsoft.Exchange.Management.RecipientTask
s.NewUnifiedGroup - PSComputerName : outlook.office365.com
I suspect it is related. I can list groups just fine. Just can't create or update.
-