Get all workflows associated with all lists in Site

Here I have written a PowerShell script to find details of all workflows associated with all lists in Site Collection.

//Script Starts

Add-PSSnapin Microsoft.Sharepoint.Powershell
$url = “http://contoso.com”

$spSite = new-object Microsoft.SharePoint.SPSite($url)
foreach($web in $spSite.AllWebs)
{
foreach($list in $web.Lists)
{
foreach($wf in $list.WorkflowAssociations)
{
Write-Host “$($list.Title)” -foreground White
 Write-Host “$($wf.Name)” -foreground Green
}
}

}
$spSite.Dispose()

//Script ends

This script provides details on workflow associated with list, once we get the information about workflow, we can execute other commands as required.

————————————–

for queries, suggestions, feedback contact me on

email :bipinparshottam@gmail.com

skype: bipin.pankhania

Advertisements