注: PowerShellとの連携には、ShareGate MigrateのProまたはEnterpriseサブスクリプションが必要です。Essentialsプランでは利用できません。
個々の接続を1つずつ行わずに複数の特定のサイト コレクションをExplorerに接続するには、PowerShellスクリプトで-AddToExplorerパラメーターを使用します。
ヒント: Explorerから接続をエクスポート・インポートして、他のShareGate Migrateユーザーと共有することもできます。
ヒント: 追加した接続は、SettingsのConnectionsセクションにあるConnection Managerにも保存され、表示・更新・削除ができます。ShareGate Migrateで接続を管理するを参照してください。
Explore画面に単一のサイト コレクションを追加する
次のスクリプトをお好みのPowerShellアプリケーションにコピー&ペーストします。
# Import the Sharegate module
Import-Module Sharegate
# Define user credentials
$myUsername = "myusername"
$myPassword = ConvertTo-SecureString 'mypassword' -AsPlainText -Force
# Connect to the SharePoint site and add it to File Explorer
Connect-Site -Url "http://yourtenant.sharepoint.com/sites/yoursitecollection" -Username $myUsername -Password $myPassword -AddToExplorer
ご自身の環境に合わせてスクリプトを調整してください。以下はいくつかのガイドラインです。
$myUsernameと$myPassword: "myusername"と'mypassword'をご自身のSharePointまたはMicrosoft 365の資格情報に置き換えます。
Connect-Site: 認証方法を変更する必要がある場合は、Connect Siteの記事で方法を確認できます。
-URL: URLをご自身のサイト コレクションのURLに置き換えます。
スクリプトの調整とテストが完了したら実行します。
ヒント: このスクリプトでは、URLが異なる複数のConnect-Site行を用意することで、複数のサイト コレクションをExplorerに追加できます。接続するサイトが多い場合は、代わりに下記のCSVを使う方法をお勧めします。
CSVを使用して複数のサイト コレクションをExplorerに追加する
接続用のCSVガイドを作成する
スクリプトを作成する
次のスクリプトをお好みのPowerShellアプリケーションにコピー&ペーストします。
# Import the Sharegate module
Import-Module Sharegate
# Define the path to the CSV file
$csvFile = "C:\CSVfile.csv"
# Import the CSV file into a table (array of objects)
$table = Import-Csv $csvFile
# Define user credentials
$myUsername = "myusername"
$myPassword = ConvertTo-SecureString 'mypassword' -AsPlainText -Force
# Loop through each row in the CSV table and connect to the specified SharePoint site
foreach ($row in $table) {
Connect-Site -Url $row.URL -Username $myUsername -Password $myPassword -AddToExplorer
}
ご自身の環境に合わせてスクリプトを調整してください。以下はいくつかのガイドラインです。
$csvFile: 事前に保存したCSVファイルを指すようにパスを調整します。
$myUsernameと$myPassword: "myusername"と'mypassword'をご自身のSharePointまたはMicrosoft 365の資格情報に置き換えます。
Connect-site: 認証方法を変更する必要がある場合は、Connect Siteの記事で方法を確認できます。
foreach: CSVファイルの各行に対して、括弧内のコマンドをループ実行します。この場合、ShareGate MigrateのExplorerに接続を追加します。
スクリプトの調整とテストが完了したら実行します。
この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。
