question

JohnMeyers-6043 avatar image
0 Votes"
JohnMeyers-6043 asked JohnMeyers-6043 edited

set-mailboxregionalconfiguration unauthorized via certificate based auth

It appears that the ability to call the 'set-mailboxregionalconfiguration' cmdlet when using certificate based authentication with exchangeOnline v2 module stopped working sometime in the last couple of weeks (early/mid-April). Prior to that it was working just fine in our provisioning scripts. If I authenticate manually with a global admin account to exchangeOnline, the cmdlet works fine. Just wondering if anyone else has run into this and if there's a work-around? Have tried adding more rights on the app registration side of things to no avail. I know there's some other cmdlets that are also broken (rights-wise) via certificate based auth.

Thanks.

windows-server-powershelloffice-exchange-server-administrationoffice-exchange-online-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered JohnMeyers-6043 commented

Hello JohnMeyers,

This may be related with recent releases of the EXO v2 Module

To report bugs please check: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#report-bugs-and-issues-for-the-exo-v2-module

But first I would recommend to update the module as per instructions in the official article:

https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#update-the-exo-v2-module



--If the reply is helpful, please Upvote and Accept as answer--

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the comment LT2700.

I've already updated to the latest supported release of EXO v2 under Powershell 5.1. This was working just fine until April 25th when I started getting the 'unauthorized' error when issuing the command. An example looks like,

==
Error on proxy command 'Set-MailboxRegionalConfiguration -Identity:'some.user@our.domain' -Confirm:$False
-Language:'en-US' -TimeZone:'Eastern Standard Time'' to server SN6PR01MB3950.prod.exchangelabs.com: Server version
15.20.5186.0000, Proxy method PSWS:
Request return error with following error message:
The remote server returned an error: (401) Unauthorized..
[Server=MW2PR0102MB3498,RequestId=5f589adf-a041-4674-8b51-d97a55b80b40,TimeStamp=5/2/2022 6:51:12 AM] .
+ CategoryInfo : NotSpecified: (:) [Set-MailboxRegionalConfiguration], CmdletProxyException
+ FullyQualifiedErrorId : [Server=MW2PR0102MB3498,RequestId=5f589adf-a041-4674-8b51-d97a55b80b40,TimeStamp=5/2/202 2 6:51:12 AM] [FailureCategory=Cmdlet-CmdletProxyException] 1FFDE062,Microsoft.Exchange.Management.StoreTasks.SetM
ailboxRegionalConfiguration
+ PSComputerName : outlook.office365.com
==

I've actually updated the api permissions to give it full readwrite on just about everything I can think of on the ExchangeOnline side of things. Again, this was working just fine and then stopped on April 25th with no changes to our environment during that timeframe.

I ran into to something similar with some group related cmdlets that was a known issue with no fix available.

0 Votes 0 ·
JohnMeyers-6043 avatar image
0 Votes"
JohnMeyers-6043 answered JohnMeyers-6043 commented

Ok, so some additional testing this morning and I come to find out it's actually working this morning without error. Was trying out a newer preview release on a fresh install and it was working, so rolled back to the non-preview release and it's also working. Just tried it on my production host and it's working there also, so Microsoft must have fixed something related to this. At least it only took them a little over a week to get it sorted out. Will post a follow-up if it starts failing again.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

So I reenabled this operation using 'set-mailboxregionalconfiguration' in my production side and just this past week started having some additional issues with it. Basically the time to execute this command is all over the place from taking 30 seconds, 5-10 minutes to complete, to just hanging in one case. Really unstable operation of this cmdlet, so I've since disabled it again in my code. Starting to lose faith in Microsoft's ability to execute the changes they're implementing recently.

0 Votes 0 ·

You should probably add the office-exchange-server-administration tag to your original post. The problem you have is with a product-specific cmdlet (written by the product group). While the cmdlet may be run in PowerShell it's not part of the delivered PowerShell product.

The Exchange SMEs will have a much better understanding of the environment in which that cmdlet operates.

0 Votes 0 ·

Thanks for the suggestion, definitely appreciate that. Somewhat new to this site and still having issues with a fair number of the screens and update options.

0 Votes 0 ·