Forum Discussion
chad-at-danaher
Jul 12, 2023Copper Contributor
Error connecting to ExchangeOnline with PowerShell 7 - "Error Acquiring Token:...."
I can connect to EXO with PowerShell 5.1 fine. I just installed PS 7.3.5. When I run Connect-ExchangeOnline I get the following error: PS C:\> Connect-ExchangeOnline Error Acquiring Token: Syst...
kevkelly
Brass Contributor
What version of the Exchange Online Management module do you have installed? You can check the version by running the following:
Import-Module ExchangeOnlineManagement
Get-Module ExchangeOnlineManagement
chad-at-danaher
Jul 13, 2023Copper Contributor
kevkelly the module version is 3.2.0
- AlexterneuzenJul 13, 2023Copper ContributorMake sure that tls1.2 is enabled
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - kevkellyJul 14, 2023Brass Contributor
PowerShell 7.3.5 should be supported in version 3.2.0 of the ExchangeOnlineManagement module as stated in the Exchange Online PowerShell module
Check the security protocol that is in use:
[Net.ServicePointManager]::SecurityProtocol
And as Alexterneuzen stated, use the following to set to Tls1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12