Skip to main content
Nintex Community Menu Bar

Identify all the Workflow Owners/publisher

  • June 3, 2016
  • 2 replies
  • 109 views

Forum|alt.badge.img+3

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?

2 replies

Forum|alt.badge.img+7
  • June 7, 2016

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.

185664_pastedImage_0.png

Jan


Forum|alt.badge.img+3
  • Author
  • June 13, 2016

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);"[WFOwnerLogin]"= (Get-SPUser -Web $wb -Identity $wf.Author);"[ListName]"=$ls.Title;"[Workflow Title]"=$wf.Name }

        New-Object PSObject -Property $output | Sort-Object;

         }

     }

    }

    }

  }

  DisplayWorkflows | Export-Csv  C:ListofWorkflows.csv