ExchangeOnline sync error Could not load type 'Microsoft.IdentityModel.Abstractions.ITelemetryClient'

Hi

After updating the ExchangeOnlineManagement PS-module to version 3.6.0 I get this error istantly when running a sync:

[1777018] Error running synchronization project (Exchange Online)'s workflow (Initial Synchronization).
[1777292] Error connecting system (Exchange Online Connector)!
[System.Management.Automation.RuntimeException] Could not load type 'Microsoft.IdentityModel.Abstractions.ITelemetryClient' from assembly 'Microsoft.IdentityModel.Abstractions, Version=6.19.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
[System.TypeLoadException] Could not load type 'Microsoft.IdentityModel.Abstractions.ITelemetryClient' from assembly 'Microsoft.IdentityModel.Abstractions, Version=6.19.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Any ideas?

/Henrik

Identity Manager version 9.1.1

$PSVersionTable:
Name Value
---- -----
PSVersion 5.1.20348.2849
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2849
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

  • Hello Henrik

    I ran into the same issue in my environment version 9.1.1, which led me to your post.

    I was getting the same error when trying to execute PowerShell commands via processes using the PowerShell component Net4.

    ErrorMessages	(2025-03-17 13:26:05.750) [Progress] Preparing modules for first use.
    [System.Management.Automation.RuntimeException] Could not load type 'Microsoft.IdentityModel.Abstractions.ITelemetryClient' from assembly 'Microsoft.IdentityModel.Abstractions, Version=6.19.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
    [System.TypeLoadException] Could not load type 'Microsoft.IdentityModel.Abstractions.ITelemetryClient' from assembly 'Microsoft.IdentityModel.Abstractions, Version=6.19.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
       at StdioProcessor.StdioProcessor._Execute(Job job)
       at VI.Jobservice.JobComponents.PowershellComponentNet4.Activate(String task)
       at VI.Jobservice.JobComponents.PoshBaseTask.Execute()
       at VI.Base.PowerShell.Runner.RunspaceUtils.Run(Runspace target, IPoshExecutionItem item, Int32 maxDeserDepth)
       at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
       ---- Start of Inner Exception ----
       at Microsoft.Exchange.Management.ExoPowershellSnapin.GetConnectionContext.ProcessRecord()
       at Microsoft.Exchange.Management.AdminApiProvider.Authentication.TokenProviderFactory.CreateTokenProvider(TokenProviderContext context, ICmdletLogger cmdletLogger)
       at Microsoft.Exchange.Management.AdminApiProvider.Authentication.MSALTokenProvider..ctor(TokenProviderContext tokenProviderContext, ICmdletLogger cmdletLogger)
       at Microsoft.Exchange.Management.AdminApiProvider.Authentication.MSALTokenProvider.GetConfidentialClientInstance()
       at Microsoft.Identity.Client.ConfidentialClientApplicationBuilder.Create(String clientId)
       at Microsoft.Identity.Client.ApplicationConfiguration..ctor(MsalClientType applicationType)

     Here's what worked for me:

    1. Installed ExchangeOnlineManagement v3.7.1 for all users.

    2. Went to: C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.7.1\netFramework

    3. Found and copied Microsoft.IdentityModel.Abstractions.dll from that folder.

    4. Navigated to the One Identity installation folder (for me, it was: C:\Program Files\One Identity\One Identity Manager)

    5. Found the existing Microsoft.IdentityModel.Abstractions.dll and made a backup.

    6. Replaced it with the newer Microsoft.IdentityModel.Abstractions.dll (from ExchangeOnlineManagement v3.7.1).

    I am not sure if it's correct but it solved the issue for me, I hope it helps you.