Microsoft 365 Backup - Warning "Cannot change web parts export mode to 'all' on SharePoint Sites Backup

A common warning on backup jobs is the one with the following description:

 

Processing site <URL> finished with warning: Cannot change web part export mode to ‘All’, because custom scripting is disabled for site: <URL>. Web part will be skipped

 

  1. Download and install the latest SharePoint Online Management Shell:
    https://go.microsoft.com/fwlink/p/?LinkId=255251

  2. Connect to SharePoint as a global admin or SharePoint admin in Microsoft 365:

    Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version

     

  3. If your operating system is using PowerShell 5 or newer, you can also install the SharePoint Online Management Shell by running the following command in administrative mode:

    Install-Module -Name Microsoft.Online.SharePoint.PowerShell

     

  4. To ensure you have all available cmdlets, you should always make sure the module is up-to-date. You can update the SharePoint Online Management Shell by running the following command in administrative mode:

     

  5. To connect with a username and password, run the following command at the SharePoint Online Management Shell command prompt:

    Connect-SPOService -Url https://contoso-admin.sharepoint.com -Credential admin@contoso.com

     

  6. When prompted with the Windows PowerShell credential request dialog, type the password for the SharePoint admin account.

  7. To connect with multifactor authentication (MFA), run the following command at the SharePoint Online Management Shell command prompt:

     

  8. When prompted with the Microsoft SharePoint Online Management Shell dialog, type the account name and password for a SharePoint Administrator account and then click “Sign in”.
    Follow the instructions in the Microsoft SharePoint Online Management Shell dialog to provide the additional authentication information, such as a verification code, and then click “Sign in”.

     

  9. Run the following command:

     

  10. If you change this setting for a user’s OneDrive or a classic team site, it will be overwritten by the Custom Script setting in the admin center within 24 hours.