zoukankan      html  css  js  c++  java
  • 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 ->
    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的,其他类型的都不可以!!!

  • 相关阅读:
    Thinkphp+Nginx(PHPstudy)下报的404错误,403错误解决
    浅谈 PHP 与手机 APP 开发(API 接口开发)
    B/S架构与C/S架构的区别
    动态查询:getBy字段名
    Cannot declare class apphomecontrollerCases because the name is already in use
    TP5与TP3.X对比
    SuperSpider——打造功能强大的爬虫利器
    阵列卡,组成的磁盘组就像是一个硬盘,pci-e扩展出sata3.0
    查看Linux系统下Raid信息
    网格计算, 云计算, 集群计算, 分布式计算, 超级计算
  • 原文地址:https://www.cnblogs.com/LanTianYou/p/4843630.html
Copyright © 2011-2022 走看看