SharePoint Online: Enable SharePoint Designer using PowerShell

Requirement: Enable SharePoint Designer for a SharePoint Online site.

SharePoint Online: How to Enable SharePoint Designer?
By default, SharePoint designer customizations are disabled for modern group sites in SharePoint Online. It gives an error message "The server could not complete your request." when you try to open a SharePoint Online group site in SharePoint Designer.
sharepoint online enable sharepoint designer

Also, It gives "You do not have permission to open this web site in SharePoint Designer" error message:
sharepoint online you do not have permission to open this web site in sharepoint designer

How to Enable SharePoint Designer in SharePoint Online?
To enable SharePoint Designer, follow these steps:
  • Sign in to Office 365 and go to the SharePoint Online Admin Center.
  • Click on Settings from the left navigation >> Scroll down to "Custom Script" section
  • Under the Custom Script section, Set "Allow users to run custom script on personal site" and "Allow users to run custom script on self-service created sites" options. 
    enable custom script sharepoint online powershell
  • Click on "OK" to save your changes.
This enables SharePoint Designer in SharePoint Online. However, this change may take up to 24 hours to reflect. To enable SharePoint Designer on a particular site collection immediately, use this PowerShell script through SharePoint Online Management Shell. Also, when you enable custom scripting through the web interface, you enable it for all sites in the tenant. However, you can enable or disable custom scripting on a specific site collection through PowerShell.

PowerShell to Enable SharePoint Designer:
If you want to enable SharePoint designer, use this PowerShell script:
#Set Parameters

#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL -Credential (Get-Credential)

#Enable SharePoint Designer for the site collection
Set-SPOSite -Identity $SiteURL -DenyAddAndCustomizePages $False

To Disable SharePoint Designer customization for a SharePoint Online site collection, use:
#DisableSharePoint Designer for the site collection
Set-SPOSite -Identity $SiteURL -DenyAddAndCustomizePages $True

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.