我可以通过Powershell对所有项目运行工作流程吗? [英] Can I run a workflow against all items via powershell?
问题描述
嘿,SharePoint Fam,
Hey SharePoint Fam,
我有一个列表,其中包含大约18,000个项目,所有项目都需要更新. 单独编辑每个人会很费时间,是否有任何一种脚本可用于自动触发工作流程同时针对所有18,000条记录运行 时间? 我能够运行此脚本,但它只能每5分钟运行一次,并且也没有完成所有18,000项内容
I have a list that has around 18,000 items that all need to be updated. editing each one individually will be time consuming, is there any kind of script that can be used to automatically trigger the workflow to run against all 18,000 records at one time? I was able to run this script but it only runs every 5 minutes and it also didnt complete all 18,000 items
# URL of the Site
$web = Get-SPWeb -Identity "https://sharepointsrv/site1"
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["Shared Documents"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("On Item Created","en-US")
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
}
$manager.Dispose()
$web.Dispose()
#
谢谢N Advance
Thanks N Advance
推荐答案
您好,
SharePoint 2013工作流程有局限性,您可以在下面查看详细信息.
https://technet.microsoft.com/en-us/library/cc262787.aspx#Workflow
因此,我建议您分批运行工作流程,可以将参数定义为每批的数量.
这里有一些链接供您参考.
此处是供您参考的链接.
https://technet.microsoft.com/en-us/library/ee177002.aspx
这篇关于我可以通过Powershell对所有项目运行工作流程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!