I am following the document here

and trying to block a site for unmanaged devices using the command below:

Set-SPOSite -Identity https://<SharePoint online URL>/sites/<name of site or OneDrive account> -ConditionalAccessPolicy BlockAccess

But I am getting following errors:

Set-SPOSite : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1 + Set-SPOSite -Identity https://xxxxxx.sharepoint.com/sites/VerySecure -C ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-SPOSite], ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Online.SharePoint.PowerShell.SetSite

Can anyone please help me.


I can run this command without error.

Install the latest version of SharePoint Online Management Shell as @Vladimir Herrlein suggests and then test again as a global administrator.

Connect-SPOService -Url https://<tenant>-admin.sharepoint.com -credential <admin account>

Set-SPOSite -Identity <siteURL> -ConditionalAccessPolicy BlockAccess
  • @Nlama Have you run the SharePoint Online Management Shell as Administrator? Nov 4 '19 at 9:37
  • yes, I am global administrator in my tenant
    – Nlama
    Nov 4 '19 at 9:50
  • @Nlama Is this global Administrator also a site collection Administrator? Maybe try another site URL and see the result. Nov 5 '19 at 6:27
  • None of the above solution works, still having an issue with this. Created a several ticket and Microsoft team is not help me to fix this issue. Anyone out there also having the same issue.
    – Nlama
    Nov 12 '19 at 18:28

Add -nowait to the end and the command will execute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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