Retrieve all SharePoint online "site workflows" in powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-1024977%22%20slang%3D%22en-US%22%3ERetrieve%20all%20SharePoint%20online%20%22site%20workflows%22%20in%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024977%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%2C%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20i%20can%20get%20the%20details%20of%20Site%20workflow%20from%20Powershell%20%3F%20I%20am%20able%20to%20retrieve%20the%20'list%20workflow'%20details%20using%26nbsp%3BEnumerateSubscriptionsByList(%3CLISTID%3E)%26nbsp%3B%20but%20not%20the%20site%20workflows.%3C%2FLISTID%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBelow%20is%20the%20code%20snippet%20i%20am%20trying%20this%20gives%20me%20all%20the%20workflows%20(both%20site%20and%20list)%20but%20not%20sure%20how%20to%20retrieve%20the%20type%20of%20workflow.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24WorkflowServicesManager%20%3D%20New-Object%20Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager(%24context%2C%24objweb)%3CBR%20%2F%3E%24context.Load(%24WorkflowServicesManager)%3CBR%20%2F%3E%24context.ExecuteQuery()%3CBR%20%2F%3E%24WorkflowSubscriptionService%20%3D%20%24workflowServicesManager.GetWorkflowSubscriptionService()%3CBR%20%2F%3E%24context.Load(%24WorkflowSubscriptionService)%3CBR%20%2F%3E%24context.ExecuteQuery()%3CBR%20%2F%3E%24siteworkflows%3D%24WorkflowSubscriptionService.EnumerateSubscriptions()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi ,

Is there a way i can get the details of Site workflow from Powershell ? I am able to retrieve the 'list workflow' details using EnumerateSubscriptionsByList(<ListID>)  but not the site workflows.

 

Below is the code snippet i am trying this gives me all the workflows (both site and list) but not sure how to retrieve the type of workflow.  

 

$WorkflowServicesManager = New-Object Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager($context,$objweb)
$context.Load($WorkflowServicesManager)
$context.ExecuteQuery()
$WorkflowSubscriptionService = $workflowServicesManager.GetWorkflowSubscriptionService()
$context.Load($WorkflowSubscriptionService)
$context.ExecuteQuery()
$siteworkflows=$WorkflowSubscriptionService.EnumerateSubscriptions()

 

 

0 Replies