- you must have access to the namespace Microsoft.SharePoint.Client
- you MUST run this script with at least Admin permissions for the Site Collection in question
- The functionality to enable and disable this must have been set during the site collection creation. By default it is NOT. You can check that on the Site Collection properties.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
$rootSite = new-object Microsoft.SharePoint.SPSite($url)
if($rootSite.RootWeb.AllowDesignerForCurrentUser -eq "true")
$rootSite.AllowDesigner = false
write-output "site "$($rootSite.RootWeb.Title)) "locked for SharePoint designer"
write-output "site "$($rootSite.RootWeb.Title)) "does not allow designer to be configured for this site collection"
Additionally you can also try other configurations to increase the lockdown surface for nasty actions that can be accomplished by some users, such as :
See you later,
By Edge Pereira