powershell-intune-samples icon indicating copy to clipboard operation
powershell-intune-samples copied to clipboard

The script requires old version of AzureAD 2.0.2.140

Open Jumpy-007 opened this issue 7 months ago • 2 comments

The script requires old version of AzureAD 2.0.2.140 and is unable to authenticate when you have this AzureAD version installed.

If you have the latest AzureAD version it doesn't show the authentication popup and gives below errors

s1:87 Line | 87 | [System.Reflection.Assembly]::LoadFrom($adal) | Out-Null | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly | 'C:\Users\username\OneDrive | \Documents\PowerShell\Modules\AzureAD\2.0.2.182\Microsoft.IdentityModel.Clients.ActiveDirectory.dll'. The | system cannot find the file specified." MethodInvocationException: C:\Users\username\OneDrive\Documents\scripts\Intune\EndpointSecurityPolicy_Get.ps1:89 Line | 89 | [System.Reflection.Assembly]::LoadFrom($adalforms) | Out-Null | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly | 'C:\Users\username\OneDrive | \Documents\PowerShell\Modules\AzureAD\2.0.2.182\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll'. | The system cannot find the file specified." Cannot find type [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext]: verify that the assembly containing this type is loaded.

Jumpy-007 avatar Jun 11 '25 10:06 Jumpy-007

Any ideas how to fix this?

artemt-yavica avatar Jun 27 '25 07:06 artemt-yavica

Any updates on this fix. I have tried

Uninstall-Module -Name AzureAD Install-Module AzureAD -RequiredVersion 2.0.2.140

But still the same issue?

Mtaddeo1010 avatar Jul 16 '25 13:07 Mtaddeo1010