v4.1 o365 Discovery/Sync error: o365.ps1: line 45
Created: 2022-09-27 17:47:39Modified: 2022-10-14 14:03:11
Tags: Office 365 Troubleshooting UnitySync
This error applies to UnitySync v4.x connections using o365 directory. Discovery or Sync may fail with the error shown below.
To fix this problem:
- Make a backup copy of \bin\o365.ps1
Edit \bin\o365.ps1
After this line:
$UserCredential = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$passwordINSERT this line:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- Save \bin\o365.ps1
Below is an example of the error as it appears in the UnitySync log:
Powershell Error | One or more errors occurred.
MyCommand : New-ExoPSSession
BoundParameters : {}
UnboundArguments : {}
ScriptLineNumber : 475
CommandOrigin : Internal
DisplayScriptPosition : at Connect-ExchangeOnline
(Process), C:\ProgramFiles\WindowsPowerShell\ Modules\ExchangeOnlineManagement\2.0.4\
netFramework\ExchangeOnlineManagement.psm1: line 475 at
Run Summary : 09/26/22 09:38:38
Run Time | 7 seconds
Error Summary : 09/26/22 09:38:38
Powershell Error | 1