Migration Error from on-premise to SharePoint Online in Office 365


Copying to an Office 365 Site Collection requires Custom Scripts to be enabled at the destination

Using the Sharegate Desktop to Migrate on-premise team sites to Office 365 failed with Custom Scripts error

I was able to resolve this with the following script:




asnp *office*
$adminUPN="Admin@orgname.onmicrosoft.com"
$orgName="OrgName"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential


$sites = Get-SPOSite -Limit all
foreach ($site in $sites)
{
Set-SPOSite $site -DenyAddAndCustomizePages 0
}





Please make sure you understand the security implications of this change. In my case, I was able to re-enable custom scripts on most of the sites following the migration without errors.

Prerequisite is the SharePoint Online Management Shell

Comments

Popular posts from this blog

Robocopy Error 31 A device attached to the system is not functioning

"The following factors also affect the level of access for" user with excess permissions

Unknown server tag 'AdminControls:MigrationToolPromotionTip'. in Central Admin after installing SharePoint 2013 security update KB4482464