Copy a List in SharePoint Online Using PowerShell
# 1. Copy
with in site
$SiteURL = "https://SiteURL/sites/Retail/"
$SourceListName = "MyDocuments"
$DestinationListName = "MyDocuments_New"
Try {
Connect-PnPOnline -Url $SiteURL -Interactive
Copy-PnPList -Identity $SourceListName -Title $DestinationListName
}
Catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
# 2. Copy
to another site with in Site Collection
$SiteURL = "https://SourceSiteUrl/sites/Retail/"
$SourceListName = "MyDocuments"
$DestinationSiteURL = "https://DestinationSiteURL/sites/Sales/"
$DestinationListName = "MyDocuments_New"
Try {
Connect-PnPOnline -Url $SiteURL -Interactive
Copy-PnPList -Identity $SourceListName -Title $DestinationListName -DestinationWebUrl $DestinationSiteURL
}
Catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
# 3. Copy
to another Site Collection
$SourceSiteURL = "https://SourceSite/sites/one"
$TargetSiteURL = "https://TargetSite/sites/two"
$ListName = "TestList"
$TemplateFile = "C:\\Template.xml"
Connect-PnPOnline -Url $SourceSiteURL -Interactive
Get-PnPSiteTemplate -Out $TemplateFile -ListsToExtract $ListName -Handlers Lists
Add-PnPDataRowsToSiteTemplate -Path $TemplateFile -List $ListName
Connect-PnPOnline -Url $TargetSiteURL -Interactive
Invoke-PnPSiteTemplate -Path $TemplateFile
$SourceListName = "MyDocuments"
$DestinationListName = "MyDocuments_New"
Connect-PnPOnline -Url $SiteURL -Interactive
Copy-PnPList -Identity $SourceListName -Title $DestinationListName
}
Catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
$SiteURL = "https://SourceSiteUrl/sites/Retail/"
$SourceListName = "MyDocuments"
$DestinationListName = "MyDocuments_New"
Connect-PnPOnline -Url $SiteURL -Interactive
Copy-PnPList -Identity $SourceListName -Title $DestinationListName -DestinationWebUrl $DestinationSiteURL
}
Catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
$SourceSiteURL = "https://SourceSite/sites/one"
$TargetSiteURL = "https://TargetSite/sites/two"
$ListName = "TestList"
$TemplateFile = "C:\\Template.xml"
Get-PnPSiteTemplate -Out $TemplateFile -ListsToExtract $ListName -Handlers Lists
Add-PnPDataRowsToSiteTemplate -Path $TemplateFile -List $ListName
Connect-PnPOnline -Url $TargetSiteURL -Interactive
Invoke-PnPSiteTemplate -Path $TemplateFile
6D4FEF6DD2
ReplyDeleteGörüntülü Sex
Ücretli Show
Skype Show
DFB7E07BBE
ReplyDeleteTakipçi Satın Al
İndirim Kuponu
Mp3 Dönüştürücü
8CDCC1F073
ReplyDeleteIn today's digital age, staying updated with the latest trends can be challenging, but resources like online tutorials and forums make it easier. If you're interested in exploring more about this topic, you can click here for comprehensive guides and community support. Embracing new technologies can significantly enhance your skills and open up new opportunities. Remember, continuous learning is key to staying ahead in any field.
The creators behind the remarkable winmtr.io website have done an incredible job. The diagnostic software is reliable, documentation is helpful, and every feature supports accurate identification of network routing and latency problems with ease.
ReplyDeleteMany thanks for creating the valuable tuxtyping.com website that makes typing practice exciting and productive. Every feature is thoughtfully designed, navigation is simple, and users benefit from enjoyable exercises that improve typing skills over time.
ReplyDeleteCongratulations on building the remarkable localeemulator.org website with excellent documentation and reliable software. Every feature is thoughtfully presented, making it easy for users to understand and use locale emulation effectively without technical confusion.
ReplyDelete