码迷,mamicode.com
首页 > 其他好文 > 详细

SharePoint Content Deployment prerequisite——Error features deactivate automation

时间:2015-09-28 13:17:03      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:

对于Content Deployment的过程简而言之就是:

General Application Settings -> Content Deployment ->
1) Configure content deployment :
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.

SharePoint Content Deployment prerequisite——Error features deactivate automation

标签:

原文地址:http://www.cnblogs.com/LanTianYou/p/4843630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!