SharePoint自动化系列——Error features自动deactivate
轉載請注明出自天外歸云的博客園:http://www.cnblogs.com/LanTianYou/
SharePoint Content Deployment prerequisite——Error features deactivate automation
對于Content Deployment的過程簡而言之就是:
General Application Settings -> Content Deployment ->
1) Configure content deployment :
Accept Content Deployment Jobs ->Accept incoming content deployment jobs
Connection Security ->Do not require encryption
Source Status Check ->Disable Source Status Check
->OK
2) Check deployment of specific content :
Type in the source url and check the definition.
3) Manage Content Deployment Paths and Jobs:
New Path(Create the path from source to definition)
Notice: The source web application's content database should distinguish the content database of the destinition web application.
New Job(Create the job under the path to achieve the deployment of the content)
但是在跑job之前,我們要確保做好了prerequisite,如下:
1) 在Site collection feature中激活Content Deployment Source Feature以及Cross-Site Collection Publishing feature。
2) 檢查Content Deployment Source Status,把所有Error features全都deactivate掉。
對于Error features的deactivate過程,我們通過PowerShell來完成,這里我將Disable-SPFeature命令進行了簡單的封裝,方便我們的使用,代碼如下:
Add-PSSnapin Microsoft.SharePoint.PowerShell function DeactivateSPFeature($featureName, $siteUrl) {Disable-SPFeature –Identity $featureName –URL $siteUrl } function autoDeactivateSPFeature(){$flag = $true$siteUrl = Read-Host "Enter the site url"While($flag){$featureName = Read-Host "Enter the feature name"DeactivateSPFeature $featureName $siteUrl$choice = Read-Host "Press 'c' to continue, any other key to quit"if($choice -ne 'c'){$flag = $false}} } autoDeactivateSPFeature保存到本地ps1文件,執行時run with PowerShell即可,在IDE中執行效果如下:
所有的Error features都deactivate之后,頁面上會提示:
“There are no errors and this Site Collection is ready for Content Deployment.”
3) 還有最最重要的一點,目的段的site template一定要注意必須是blank的,其他類型的都不可以!!!
總結
以上是生活随笔為你收集整理的SharePoint自动化系列——Error features自动deactivate的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一篇小的随笔,关于记忆算法和概念
- 下一篇: ios两张图片的合并