如何使用C#在SharePoint 2013或2016中克隆网站集 [英] how to make a clone of site collection in SharePoint 2013 or 2016 using C#
问题描述
我必须使用C#克隆Sitecollection.我知道有使用Powershell脚本的方法,但是我只想使用C#.
I have to make a clone of Sitecollection using C#. i know there is way to do using Powershell script but i want to use C# only.
Copy-SPSite {Source-Site-Collection-URL} [-DestinationDatabase {Destination-Database-Name}] -TargetUrl {Target-Site-Collection-URL}
Copy-SPSite {Source-Site-Collection-URL} [-DestinationDatabase {Destination-Database-Name}] -TargetUrl {Target-Site-Collection-URL}
此命令在C#中的替代版本
alternative of this command in in C#
.
推荐答案
请尝试使用备份和还原来实现它.
Please try to use Backup and Restore to achieve it.
方法:以编程方式备份和还原单个网站集
https://msdn.microsoft.com/en-us/library/cc264319(v = office.14).aspx
或者我们也可以用C#代码运行PowerShell脚本.
Or we can also run the PowerShell script in C# code.
如何从C#代码执行PowerShell脚本(ps1文件)
http://sharepointpals.com/post /How-to-execute-PowerShell-script-(ps1-file)-来自C代码
最好的问候,
这篇关于如何使用C#在SharePoint 2013或2016中克隆网站集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!