In one of my previous blogs I explained how you can use Intune and SharePoint Online together. The blog ended with me being somewhat annoyed by the fact that I couldn’t get the site-collection based conditional access working.
In the meantime, Microsoft has released a new version of the SharePoint Online PowerShell management shell and after importing the new cmdlets: it works!
Just follow the steps in the previous blog (at the end), and you will notice that you can set a conditional access policy based on one or more specific site collections.
This is the cmdlet involved:
Set-SPOSite -Identity <your site-collection URL> -ConditionalAccessPolicy AllowLimitedAccess
Which will modify your site-collection like this:
If you want to disable the conditional access, run this cmdlet:
Set-SPOSite -Identity <your site-collection URL> -ConditionalAccessPolicy AllowFullAccess
And your site-collection will not be protected by a conditional access policy.