症状
Copy content only を使用して Microsoft 365 のサイトに移行すると、ライブラリで次の警告メッセージが表示されます。
Copying files that potentially include script requires enabling custom script setting at the destination.
また、一部のファイルで次のエラーメッセージが表示されます。
Enable custom script setting at the destination to copy X files.
エラーコード
AN-138-459
DA-177-459
目次
詳細
Site collection で custom script が有効になっていない場合、Microsoft 365 は ShareGate Migrate がカスタムスクリプトを含む可能性のあるファイルをアップロードすることを許可しません。
ライブラリには警告が表示され、コピーできなかった各ファイルにはエラーが表示されます。これらのファイルを Copy content only でコピーするには、移行先サイトで custom script を手動で有効にする必要があります。
custom script について詳しくは、Microsoft の記事「Allow or prevent custom script」を参照してください。
Note: SharePoint でモダンサイトを作成すると、たとえテナントレベルで有効になっている場合でも、Custom Script は無効になります。
解決策
Copy content only でモダンサイトにファイルをコピーする場合、ShareGate Migrate は custom script の設定を自動的に変更できません。SharePoint admin または global admin が手動でこの設定を有効にする必要があります。
PowerShell を使用して Microsoft 365 の Site collection で custom script を有効にするには、次の手順に従います。
SharePoint Online Management Shell をダウンロードします。
SharePoint Online Management Shell プロンプトを開きます。
次の 2 つのコマンドを実行します。
Connect-SPOService -Url https://YourDomain-admin.sharepoint.com Set-SPOSite -Identity https://YourDomain.sharepoint.com/sites/YourSite -DenyAddAndCustomizePages 0
移行を再実行すると、正常に動作するはずです。
Note: 移行後は、Custom Script を再度 denied に設定することをお勧めします。そのためには、スクリプトを再実行し、今回は -DenyAddAndCustomizePages の値を "1" に変更します。
この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。
