{"id":4231,"date":"2023-12-20T11:46:27","date_gmt":"2023-12-20T00:46:27","guid":{"rendered":"http:\/\/support.cybersecure.com\/?p=4231"},"modified":"2023-12-20T11:47:38","modified_gmt":"2023-12-20T00:47:38","slug":"cannot-change-web-part-export-mode-to-all-because-custom-scripting-is-disabled-for-site","status":"publish","type":"post","link":"http:\/\/support.cybersecure.com\/?p=4231","title":{"rendered":"Cannot change web part export mode to \u2018All\u2019, because custom scripting is disabled for site"},"content":{"rendered":"<h1>Issue<\/h1>\n<p>The following error is encountered:<\/p>\n<p>Processing site XX finished with warning: Cannot change web part export mode to \u2018All\u2019, because custom scripting is disabled for site: XX. Web part will be skipped (web part ID: XX, page: XX)<\/p>\n<h1>Cause<\/h1>\n<p>The sharepoint site denies changing the \u201cweb part export\u201d mode, which Veeam requires to take a backup.<\/p>\n<h1>Resolution<\/h1>\n<h2>Install the powershell sharepoint module<\/h2>\n<p>You only need to set this up once, after that it will be installed for future sessions<\/p>\n<ol>\n<li>Open PowerShell<\/li>\n<li>Install the SharePoint module\n<pre><code class=\"language-powershell\">Install-Module -Name Microsoft.Online.SharePoint.PowerShell\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>Remove the DenyAddAndCustomizePages restriction<\/h2>\n<ol>\n<li>Connect to ms365 via Powershell by running\n<pre><code class=\"language-powershell\">Connect-SPOService -Url \"&lt;https:\/\/orgname-admin.sharepoint.com&gt;\"\r\n<\/code><\/pre>\n<\/li>\n<li>Once signed in run this command against the site reported in the error\n<pre><code class=\"language-powershell\">Set-SPOSite -Identity \"&lt;https:\/\/orgname.sharepoint.com\/sites\/sitename&gt;\" -DenyAddAndCustomizePages 0\r\n<\/code><\/pre>\n<\/li>\n<li>Close PowerShell<\/li>\n<li>Run the backup again and confirm the error is cleared<\/li>\n<\/ol>\n<h1>Further troubleshooting<\/h1>\n<p>If you see the error<\/p>\n<pre><code class=\"language-powershell\">Connect-SPOService: The term 'Connect-SPOService' is not recognized as a name of a cmdlet, function, script file, or executable program.\r\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\n<\/code><\/pre>\n<p>Then run the older <strong>Windows Powershell<\/strong> &#8211; the one with the blue icon, not the black icon<\/p>\n<p><!-- notionvc: 9c2ee952-8636-4bbf-8b0e-d140f1931b79 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Issue The following error is encountered: Processing site XX finished with warning: Cannot change web part export mode to \u2018All\u2019, because custom scripting is disabled for site: XX. Web part will be skipped (web part ID: XX, page: XX) Cause &hellip; <a href=\"http:\/\/support.cybersecure.com\/?p=4231\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[305,1,322],"tags":[],"_links":{"self":[{"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=\/wp\/v2\/posts\/4231"}],"collection":[{"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4231"}],"version-history":[{"count":2,"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=\/wp\/v2\/posts\/4231\/revisions"}],"predecessor-version":[{"id":4233,"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=\/wp\/v2\/posts\/4231\/revisions\/4233"}],"wp:attachment":[{"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4231"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/support.cybersecure.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}