- 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.
function Lock-SharePoint-Designer-Use([string]$url)
{
[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"
}
else
{
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 :
$rootSite.AllowRevertFromTemplate
$rootSite.AllowMasterPageEditing
$rootSite.AllowShowUrlStructure
See you later,
By Edge Pereira
No comments:
Post a Comment