Due to recent changes in the Microsoft Remote PowerShell in Exchange Online
Deprecation of Remote PowerShell in Exchange Online – Re-enabling or Extending RPS support
https://techcommunity.microsoft.com/t5/exchange-team-blog/deprecation-of-remote-powershell-in-exchange-online-re-enabling/ba-p/3779692Error can be visible in PST Flight Deck, Azure AD Sync module.
Error to retrieve users
EXCEPTION: System.Management.Automation.RuntimeException: UnAuthorized ---> System.UnauthorizedAccessException: UnAuthorized
at Microsoft.Exchange.Management.ExoPowershellSnapin.NewEXOModule.CheckResponseHeadersAndGetNewTokenIfNeeded(ITokenProvider tokenProvider, HttpResponseHeaders responseHeaders, String errorMessage, String cmdletId, AuthHeader& authHeader, Boolean& isRetryHappening, String connectionUri)
at Microsoft.Exchange.Management.ExoPowershellSnapin.NewEXOModule.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
--- End of inner exception stack trace ---
at QUADROtech.PowerShell.PowerShellWrapperModern.CreateAndOpenRunspacePool()
at QUADROtech.PowerShell.PowerShellWrapperModern.get_RunspacePool()
at QUADROtech.PowerShell.PowerShellWrapperModern.ExecutePsCommand(PSCommandBase command, Boolean throwExceptionOnError, Int32 retryCount)
at QUADROtech.FlightDeck.AzureADService.Office365ADCollectorV2.GetMailboxes()
at QUADROtech.FlightDeck.AzureADService.Office365ADCollectorV2.Execute()
at QUADROtech.FlightDeck.AzureADService.SyncAzureADTask.Execute(CancellationToken cancellationToken)