Vadim Tabakman

Jump to bottom

There are times when you need to find all your workflows in your entire farm.  Nintex Workflow installs a command line tool named NWAdmin.exe on the server where you initially ran the MSI.  It's usually located in c:\Program Files\Nintex\Nintex Workflow 2010 (or 2007 if you are on that product).

NWAdmin has a number of operations, but for this post we are interested in the -o FindWorkflows operation.  It iterates through the farm and outputs the site, list and workflowname.

The output looks like this:

Active at http://ntx-vadim3:10000

-- First List
---- 3 Child Actions Workflow
---- AutoWorkflow1
---- Dont Log Workflow
---- Dummy Actions Workflow
---- First UDA Workflow
---- First Workflow
---- For Each with 1 Action Workflow
---- ForEach 10 Iterations Workflow
---- ForEach 100 Iterations Workflow
---- ForEach 1000 Iterations Workflow
---- TriState Machine Workflow

It's a nice format and quite legible.

The goal here, is to parse this information so that we can eventually do something with it.

I wrote the following PowerShell script that will run the NWAdmin command, then parse the output so that later one, we can extend the script to do more interesting things.

[IO.Directory]::SetCurrentDirectory((Convert-Path (Get-Location -PSProvider FileSystem)))

# check if we are in the same location as the nwadmin.exe
if(Test-Path(".\nwadmin.exe"))
{
  # find all the workflows and store them in a variable
  $foundworkflows = .\nwadmin -o FindWorkflows

  foreach($line in $foundworkflows)
  {
    if($line.StartsWith("Active at "))
    {
      # get the site url
      $site = $line.Replace("Active at ","");
    }
    if($line.StartsWith("-- "))
    {
      # get the list name
      $list = $line.Replace("-- ","");
    }
    if($line.StartsWith("---- "))
    {
      # get the workflow name
      $workflowname = $line.Replace("---- ","");

      $message = "{0} - {1} - {2}" -f $site,$list,$workflowname;
      echo $message;
    }
  }
}
else
{
  echo "NWAdmin doesn't exist.  Change directory to where NWAdmin.exe lives.";
}

In the script, later on, we will replace the lines :

  $message = "{0} - {1} - {2}" -f $site,$list,$workflowname;

  echo $message;

With something a little more useful.

The output of the above script is :

http://ntx-vadim3:10000 - First List - 3 Child Actions Workflow
http://ntx-vadim3:10000 - First List - AutoWorkflow1
http://ntx-vadim3:10000 - First List - Dont Log Workflow
http://ntx-vadim3:10000 - First List - Dummy Actions Workflow
http://ntx-vadim3:10000 - First List - First UDA Workflow
http://ntx-vadim3:10000 - First List - First Workflow
http://ntx-vadim3:10000 - First List - For Each with 1 Action Workflow
http://ntx-vadim3:10000 - First List - ForEach 10 Iterations Workflow
http://ntx-vadim3:10000 - First List - ForEach 100 Iterations Workflow
http://ntx-vadim3:10000 - First List - ForEach 1000 Iterations Workflow
http://ntx-vadim3:10000 - First List - TriState Machine Workflow

Note

You need to run this script in the folder that contains the NWAdmin.exe or modify the script.

Downloads

Posted by Vadim Tabakman Wednesday, August 15, 2012 7:17:00 AM Categories: Nintex Nintex Workflow PowerShell
Copyright Vadim Tabakman
Rate this Content 1 Votes

Comments

Sunday, February 28, 2016 9:00:11 PM
Chris O'Connor
Gravatar

re: Nintex Workflow - PowerShell Find All Workflows Part 1

In case you're looking for NWADMIN (I couldn't find it !) - the install location for SP2013 will be here >

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN

Monday, February 29, 2016 10:04:33 PM
Nick Cox
Gravatar

re: Nintex Workflow - PowerShell Find All Workflows Part 1

Or with a bit of luck it'll be on your path:

get-command nwadmin | select Path

Monday, March 7, 2016 9:25:21 AM

re: Nintex Workflow - PowerShell Find All Workflows Part 1

Thanks for sharing those gents.

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register
  • RSS





 

Statistics

  • Entries (239)
  • Comments (1725)

Categories