Description
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.