The following script is useful to start/update workflow for existing items in SharePoint list.
#updated workflow
# URL of the Site
$web = Get-SPWeb -Identity "<<Site URL>>"
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["<< List Name>>"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("<< Workflow Name>>","en-US")
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
}
$manager.Dispose()
$web.Dispose()
#
#updated workflow
# URL of the Site
$web = Get-SPWeb -Identity "<<Site URL>>"
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["<< List Name>>"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("<< Workflow Name>>","en-US")
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
}
$manager.Dispose()
$web.Dispose()
#
judith@mail.postmanllc.net
ReplyDeletethank you for sharing
ReplyDeleteobat kuat jakarta
obat kuat pria
obat kuat asli
viagra jakarta
viagra usa
jual viagra