If you are running this on PowerShell 7+/Core, you need to import the module in compatibility mode:
Import-Module AzureAD -UseWindowsPowerShell
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi all
i am new to powershell and azure world. i am trying to login to my office365 azure using powershell. my admin account is MFA enabled. i am using connect-azuread command. i get the prompt to enter username/password and then approve the request using authenticator. but after approval from authenticator app i always get the error
Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.)
Connect-AzureAD: Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
can you anyone please help me with this. what am i doing wrong here.
regards
If you are running this on PowerShell 7+/Core, you need to import the module in compatibility mode:
Import-Module AzureAD -UseWindowsPowerShell
Thank you, it worked for me with "Import-Module AzureAD -UseWindowsPowerShell" in VS Studio.
Hi all,
I can confirm that with PS 5 the module works.
Thank you all.
in brief:
C:\> powershell.exe -version 5.1
PS> Install-Module AzureAD
PS> Import-Module AzureAD
PS> Connect-AzureAD
regards
D
This does not work still.
Version 7.3.0 of powershell and 2.0.2.140 of AzureAD powershell module.
I get the same error trying to run "Connect-PimService".
This should no longer need the -usewindowspowershell.
Which version of the AzureAD module do you have installed, and have you updated to the latest stable version of Powershell core/7?