Hello everyone! It’s time to do some reporting on our farm – how about listing all of the workflows you have implemented throughout? It’s quite easy to do with our trusty PowerShell! So, without further ado here it is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[system.reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint.WorkflowServicesBase") | out-null $webApp = Get-SPWebApplication https://abc.contoso.com $webApp.Sites | Foreach-Object { $_.AllWebs | Foreach { $wfSubscriptionManager = new-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager $_ $wfSubscriptionService = $wfSubscriptionManager.GetWorkflowSubscriptionService(); $webUrl = $_.Url $_.Lists | Foreach { $_.WorkflowAssociations | Foreach { if ($_.Name -notlike "*(Previous Version*") { Write-Host "[2010] SiteURL: " $_.ParentWeb.Url ", List name: " $_.ParentList.Title ", Workflow name: " $_.Name } } $listTitle = $_.Title $wfSubscriptionService.EnumerateSubscriptionsByList($_.ID) | Foreach { Write-Host "[2013] SiteURL: " $webUrl ", List name: " $listTitle ", Workflow name: " $_.Name } } } } |
Basically, we need to load up “Microsoft.SharePoint.WorkflowServicesBase” dll to be able […]
Continue reading »