Share via

O365 Powershell | Error trying to connect to msolservice - Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly

Anonymous
2021-05-07T05:50:07+00:00

Hi,

I am using PS7 as an admin, I do:
import-module msonline (ok)

connect-msolservice (gives me an error: Connect-MsolService: Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.)

Any clues on what I am doing wrong?

Thanks/Brgds

j

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2021-05-07T10:32:05+00:00

    Hello Joao,

    Based on my tests and research for the MSOnline Windows Powershell, as far as I know Connect-MSOlService currently is not supported to be run from Windows PowerShell V7 or later versions.  If you want to connect to Microsoft 365 services from Windows PowerShell V7 or later, it is recommended that please use  Azure Active Directory PowerShell for Graph module or Azure PowerShell.   For more details, please refer to https://docs.microsoft.com/en-us/microsoft-365/enterprise/connect-to-microsoft-365-powershell?view=o365-worldwide >>  Connect with the Microsoft Azure Active Directory Module for Windows PowerShell

    Please feel free to let me know if you have any other concern, thanks.

    Best Regards,

    Oliver

    10+ people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful