We are in the process of changing the governance policy for workflows in my organization. So i wanted to contact all the workflow owners/publishers regarding the same. So can you please provide some script/way we can identify all the workflow owners/publishers in the farm?
Hi,
Well one way of doing this is to use the Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager class in PowerShell and use the GetWorkflowDeploymentService() method. You can then get hold of all the workflow definitions and in the Properties of each definition you'll find the info you're after.
Jan
Thanks Jan Eyres. I have used below PS to do the work:
asnp microsoft.sharepoint.powershell -erroraction silentlycontinue
$webs = Get-SPSite -Limit All | Get-SPWeb -limit All -ErrorAction SilentlyContinue| Where-Object { (get-spfeature -identity “9bf7bf98-5660-498a-9399-bc656a61ed5d” -ErrorAction SilentlyContinue -Web $_.Url) -ne $null }
function DisplayWorkflows()
{
foreach($wb in $webs)
{
$lists= $wb.Lists;
foreach($ls in $lists )
{
$workflows= $ls.WorkflowAssociations;
foreach($wf in $workflows)
{
if($wf.Name -notlike "*Previous Version*")
{
$output = @{"URL]"=$wb.url;">WFOwnerEmail]"= (Get-SPUser -Web $wb -Identity $wf.Author | Select -ExpandProperty email);"dWFOwnerLogin]"= (Get-SPUser -Web $wb -Identity $wf.Author);"oListName]"=$ls.Title;"bWorkflow Title]"=$wf.Name }
New-Object PSObject -Property $output | Sort-Object;
}
}
}
}
}
DisplayWorkflows | Export-Csv C:ListofWorkflows.csv
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.