Hi,
I wanted to write a PowerShell Script which would run in a farm and get different types of workflow (SP designer, OOB wf) and also to get no. of actions if it is a Designer workflow to understand its complexity. Is it possible?
Hi,
I wanted to write a PowerShell Script which would run in a farm and get different types of workflow (SP designer, OOB wf) and also to get no. of actions if it is a Designer workflow to understand its complexity. Is it possible?
Hi @rameezhasan-1234 ,
We can only get status by following scripts. We are unable to get the number of actions
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
$web = get-spweb -Identity https://spwebUrl
$list = $web.Lists["ListName"]
$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$sub = $wfm.GetWorkflowSubscriptionService()
$wfs = $sub.EnumerateSubscriptionsByList($list.ID)
$wfis=$wfm.GetWorkflowInstanceService()
foreach ($item in $list.Items)
{
$workflowInstances=$wfis.EnumerateInstancesForListItem($list.ID,$item.ID)
foreach($wf in $workflowInstances)
{
$wfName = $wfs | ?{$_.Id -eq $wf.WorkflowSubscriptionId} | select -ExpandProperty Name
$wfID= $wf.ID
$wfStatus = $wf.Status
$wfListItem = $item.Name
write-host "Workflow Title: $wfName Status: $wfStatus ListItem: $wfListItem"
}
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi @rameezhasan-1234 ,
Would you tell me whether your issue has been resolved or have any update?
I am looking forward to your reply.
Have a nice day!
Thanks,
Raytheon Xie
22 people are following this question.
update modified by(user type field) and security classification (taxonomy filed) using rest API
SharePoint Rest API modify "who modified by" and security classification using OAuth token postman
How to create workflows using C# on Sharepoint 2013?
Sharepoint List choice column as Dropdown1 based on selected item in Dropdown2 in Powerapps