-
Notifications
You must be signed in to change notification settings - Fork 409
Description
It appears ConnectO365Services.ps1 does not work with Exchange Online modules where the version > 3.40. I discovered this when attempting to upgrade the ExO PS module on the server where I using ConnectO365Services.ps1 -Services ExchangeOnline. I tried with ExO PS 3.7.2, 3.6, 3.51 and 3.5. Originally, I was using version 3.1.0 of the ExO module and when I downgraded to ExO PS 3.4.0, it started working again.
The error I get is:
Get-EXOMailbox : The underlying connection was closed: An unexpected error occurred on a receive.
At D:\CRON\Office365\ConnectO365Services.ps1:126 char:9
- If((Get-EXOMailbox -ResultSize 1) -ne $null)
-
- CategoryInfo : ProtocolError: (:) [Get-EXOMailbox], DataServiceTransportException
- FullyQualifiedErrorId : The underlying connection was closed: An unexpected error occurred on a receive.,Microsoft.Exchange.Management.RestApiClient.GetExoMailbox
It looks like a TLS 1.2 issue, so I added
Enforce TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
to the top of the script. Made no difference. Anyways, I just moved to cert based auth and 3.7.2 ExO PS directly on the server (vs using ConnectO365Services.ps1 -Services ExchangeOnline), but I thought you might want to know there was an issue.