microsoftgraph / powershell-intune-samples

This repository of PowerShell sample scripts show how to access Intune service resources. They demonstrate this by making HTTPS RESTful API requests to the Microsoft Graph API from PowerShell.
MIT License
1.35k stars 656 forks source link

Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] not able to load #254

Open fohnbit opened 1 year ago

fohnbit commented 1 year ago

Hello!

I get this error, after set the login email: `Ausnahme beim Aufrufen von "LoadFrom" mit 1 Argument(en): "Die Datei oder Assembly "file:///C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.2.180\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden." In C:\Users\UserXY\Downloads\powershell-intune-samples-master\SettingsCatalog\SettingsCatalog_Export.ps1:87 Zeichen:1

Ausnahme beim Aufrufen von "LoadFrom" mit 1 Argument(en): "Die Datei oder Assembly "file:///C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.2.180\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden." In C:\Users\UserXY\Downloads\powershell-intune-samples-master\SettingsCatalog\SettingsCatalog_Export.ps1:89 Zeichen:1

Der Typ [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] kann nicht gefunden werden. Stellen Sie sicher, dass die Assembly, die diesen Typ enthält, geladen wird.`

Its not able to load "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext]". How can i fix this issue?

michalorac commented 1 year ago

@fohnbit install older module AzureAD, which contain missing files

Install-Module -Name AzureAD -RequiredVersion 2.0.2.140

tenglishWGGS commented 1 year ago

@michalorac This is a good workaround but isn't the reason this is failing due to the Microsoft.IdentityModel.Clients.ActiveDirectory package being depreciated?(https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory)