powershell 这会将列表从一个SharePoint站点复制到另一个SharePoint站点
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 这会将列表从一个SharePoint站点复制到另一个SharePoint站点相关的知识,希望对你有一定的参考价值。
#Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Source List
$SourceWebURL = "https://xxxx"
$ListName = "SharedDocuments"
$BackupPath = "F:\temp\"
$TargetWebURL = "https://xxxx"
$web = Get-SPWeb -Identity https:/xxx
$SourceList = $web.GetList("https://xxx")
#Export the List from Source web
#$SourceList.DefaultViewUrl
Export-SPweb $SourceWebURL -ItemUrl $SourceList.DefaultViewUrl -IncludeUserSecurity -IncludeVersions All -path ($BackupPath + $ListName + ".cmp") -nologfile -Force
#Import the List to Target Web
import-spweb $TargetWebURL -IncludeUserSecurity -path ($BackupPath + $ListName + ".cmp") -nologfile -UpdateVersions Overwrite
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Source List
$SourceWebURL = "http://portal.opwftg.com/sites/OPWSS/Teams/Safety/SiteTemplate/Cells/Cell 1/Machines/Machine1"
$ListName = "LOTO"
$BackupPath = "E:\temp"
$TargetWebURL = "http://portal.opwftg.com/sites/OPWSS/Teams/Safety/SiteTemplate/Cells/Cell 1"
$SourceList =(Get-SPWeb $SourceWebURL).Lists[$ListName]
#Export the List from Source web
Export-SPweb $SourceWebURL -ItemUrl $SourceList.DefaultViewUrl -IncludeUserSecurity -IncludeVersions All -path ($BackupPath + $ListName + ".cmp") -nologfile -Force
#Import the List to Target Web
import-spweb $TargetWebURL -IncludeUserSecurity -path ($BackupPath + $ListName + ".cmp") -nologfile -UpdateVersions Overwrite
以上是关于powershell 这会将列表从一个SharePoint站点复制到另一个SharePoint站点的主要内容,如果未能解决你的问题,请参考以下文章
powershell 这会将内容数据库安装到SharePoint Web应用程序
更新多个 SharePoint 列表项
html 这会将文件上传到SharePoint库,并使用javascript和jquery从网页添加元数据。
从大型元组/行列表中有效地构建 Pandas DataFrame
从大型元组/行列表中有效地构建 Pandas DataFrame
Powershell - 从 AD 列表中获取用户信息