Cannot connect to Office 365 Exchange with PowerShell – system.management.automation…

Issue

Office 365 Global Admin can no longer connect to the Exchange back-end via PowerShell (Connect-ExchangeOnline). The following error is displayed:

system.management.automation.remoting.psremotingdatastructureexception

New-ExoPSSession : Connecting to remote server outlook.office365.com failed with the following error message : For more information, see the about_Remote_Troubleshooting Help topic.
At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5\ netFramework\ExchangeOnlineManagement.psml:475 char:30
+ … PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro …
+
+ Categorylnfo : ResourceUnavailable: (:) [New-ExoPSSession], PSRemotingTransportException
+ FullyQualifiedErrorld : System.Management.Automation.Remoting.PSRemotingDataStructureException, Microsoft.Exchange.Management.ExoPowershellSnapin.NewExoPSSession

Resolution

The issue was resolved by reinstalling the PowerShell ExchangeOnlineManagement module by running the following commands:

  • Uninstall-Module -Name ExchangeOnlineManagement
  • Install-Module -Name ExchangeOnlineManagement
ExchangeOnlineManagement

June 2023
Microsoft Office 365 Exchange Online
Windows 11 Pro (22H2)


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *