I'm trying to connect to SharePoint online tenant using the below PowerShell script but I get the error:

I'm sure the script is correct because it works fine on other machines. But on one particular machine where I'm supposed to work, i get this error:

Connect-SPOService : Method not found: '!!0[] System.Array.Empty()'.
At line:6 char:1
 + Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential 
 $userC ...
 + CategoryInfo          : NotSpecified: (:) [Connect-SPOService], MissingMethodException
   + FullyQualifiedErrorId : System.MissingMethodException,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService

#Connect to SharePoint Online Script

$adminUPN="User Email Address"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

enter image description here

1 Answer 1


The error message Method not found: '!!0[] System.Array.Empty()' is related to .NET Framework 4.6 not installed correctly, please refer the similiar question here:

Method not found: '!!0[] System.Array.Empty()'

You can download and install .NET Framework 4.6 here:

Microsoft .NET Framework 4.6.2 (Offline Installer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.