Batch Copy Onedrives in Sharegate via Powershell and CSV

Import-Module Sharegate
$csvFile = "C:\Scripts\Onedrive.csv"
$table = Import-Csv $csvFile -Delimiter ","

$srcsiteConnection = Connect-Site -Url https://xxxxx-admin.sharepoint.com/ -Browser
$dstsiteConnection = Connect-Site -Url https://xxxx-admin.sharepoint.com/ -Browser


Set-Variable srcSite, dstSite, srcList, dstList
foreach ($row in $table) {
 Clear-Variable srcSite
 Clear-Variable dstSite
 Clear-Variable srcList
 Clear-Variable dstList
 $srcSite = Connect-Site -Url $row.SourceSite  -UseCredentialsFrom $srcsiteConnection
 $dstSite = Connect-Site -Url $row.DestinationSite  -UseCredentialsFrom $dstsiteConnection
 $srcList = Get-List -Site $srcSite -Name "Documents"
 $dstList = Get-List -Site $dstSite -Name "Documents"
 Copy-Content -SourceList $srcList -DestinationList $dstList

}
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...