DanZab / Powershell

Collection of Work-Related Powershell Scripts
3 stars 2 forks source link

I got below error when I launch it from Power shell. #2

Open ghost opened 9 months ago

ghost commented 9 months ago

image

Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.2.182\Microsoft.IdentityModel.Clients.ActiveDirectory.dll' or one of its dependencies. The system cannot find the file specified." At line:106 char:1

Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.2.182\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll' or one of its dependencies. The system cannot find the file specified." At line:108 char:1

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

Sprsass commented 9 months ago

I also got same issue in windows 11 device. image

DanZab commented 9 months ago

This script is based on the AppleDEPProfile_Assign.ps1 script found in the powershell-intune-samples repo.

Its using a deprecated Authentication module, so in order for this to continue working, you would need to install an older version of the AzureAD Module using the following command:

Install-Module -Name AzureAD -RequiredVersion 2.0.2.140

This same issue is reported on the original repo, issue 254.

Sprsass commented 9 months ago

Thank You DanZeb. I have installed the older version and it fix the above issue however encountered with new issue during profile assignment. Would you please help me on this as well. Please refer below screenshots for your reference. image

Sprsass commented 9 months ago

Hi Dan,

I have updated GitHub page as encountered new issue.

Would you please help me on that ?

Regards Saurabh Singh

On Tue, Jan 2, 2024, 04:39 Daniel Zabinski @.***> wrote:

This script is based on the AppleDEPProfile_Assign.ps1 script found in the powershell-intune-samples https://github.com/microsoftgraph/powershell-intune-samples/blob/master/AppleEnrollment/AppleDEPProfile_Assign.ps1 repo.

Its using a deprecated Authentication module, so in order for this to continue working, you would need to install an older version of the AzureAD Module using the following command:

Install-Module -Name AzureAD -RequiredVersion 2.0.2.140

This same issue is reported on the original repo, issue 254 https://github.com/microsoftgraph/powershell-intune-samples/issues/254.

— Reply to this email directly, view it on GitHub https://github.com/DanZab/Powershell/issues/2#issuecomment-1873472392, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBHWK5UJNKEMOJEWOBC6Q3DYMMNIFAVCNFSM6AAAAABBD3ZDA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGQ3TEMZZGI . You are receiving this because you commented.Message ID: @.***>