Azure / securedworkstation

Intune managed Secured workstation
MIT License
233 stars 54 forks source link

Microsoft.IdentityModel.Clients.ActiveDirectory.dll not found #27

Open Wallace4444 opened 4 months ago

Wallace4444 commented 4 months ago

It seems this script tries to utilise an old, or no longer available, ADAL library when running.

When running MasterScript PAW.ps1, it fails with the following:

Checking for AzureAD module...
AzureAD PowerShell module not found, looking for AzureADPreview
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Users\USER\Documents\Wi
ndowsPowerShell\Modules\AzureADPreview\2.0.2.183\Microsoft.IdentityModel.Clients.ActiveDirectory.dll' or one of its
dependencies. The system cannot find the file specified."
At C:\Users\Will\downloads\securedworkstation-master\paw\Import-PAW-DeviceConfiguration.ps1:90 char:1
+ [System.Reflection.Assembly]::LoadFrom($adal) | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FileNotFoundException

Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Users\USER\Documents\Wi
ndowsPowerShell\Modules\AzureADPreview\2.0.2.183\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll' or one
of its dependencies. The system cannot find the file specified."
At C:\Users\Will\downloads\securedworkstation-master\paw\Import-PAW-DeviceConfiguration.ps1:92 char:1
+ [System.Reflection.Assembly]::LoadFrom($adalforms) | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FileNotFoundException

Cannot find type [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext]: verify that the assembly containing this type is loaded.

That file doesn't exist in AzureADPreview\2.0.2.183

lloydcarnie1 commented 3 months ago

I have the same issue....any comments from Microsoft??

Wallace4444 commented 3 months ago

Nope. The script needs to be updated to use the MSOL library instead of ADAL which is deprecated.

Disappointing that they provide this guidance, and link to a script... which just doesn't work.