SharePoint自动化系列——Error features自动deactivate

简介: 转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ SharePoint Content Deployment prerequisite——Error features deactivate automation 对于Content Depl...

转载请注明出自天外归云的博客园: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自动化系列——Site/Web/List级别的导航菜单
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 需求:在不同的测试用例中,对脚本中不确定的因素需要和用户交互来确定,比如选择哪个site,选择哪个web,选择哪个list。
843 0
SharePoint自动化系列——Add content type to list.
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 将创建好的content type(若是跨web application需要事先publish content type,并在Monitor中跑和Content type同步相关的job,这里我写...
731 0
SharePoint自动化系列——Add/Remove "Record" from items
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 目的:批量的将SharePoint items变成records或者将records变成普通的items。
755 0
SharePoint自动化系列——Content Type相关timer jobs一键执行
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 背景: 在SharePoint Central Administration->Monitoring->Job Definitions中我们可以看到所有的timer jobs,其中和Content Type相关的timer jobs有:   1.
829 0
SharePoint自动化系列——创建MMS terms
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ PowerShell脚本实现MMS group、termSet、terms的自动化创建: Add-PSSnapin Microsoft.
1081 0
SharePoint自动化系列——Create a local user and add to SharePoint
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 实现过程:在本地创建一个local user并将该user添加到Administrators组中,然后在SharePoint指定site中添加该user,并赋予Full Control的权限。
835 0
SharePoint自动化系列——Select-option标签的定位方法总结
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ C#中通过Selenium定位页面上的select-option结构,尝试了以下几种方法,均没有生效: //iw.
1246 0
|
Web App开发
SharePoint自动化系列——Add/Remove “Hold” from items
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 问题1: 1.如果SharePoint item被添加了hold,通过UI界面来对SharePoint items解锁是比较折腾的。
1157 0
SharePoint自动化系列——Manage "Site Subscriptions" using PowerShell
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 你可以将普通的sites加入到你的site subscriptions中,前提是你需要有一个 Tenant Administration site,如果没有这个site,一切都别谈了。
872 0
SharePoint自动化系列——通过PowerShell创建SharePoint List Items
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin microsoft.
920 0