List all Nintex Workflows

When needing to list the workflows within a SharePoint farm, there is a command that can be used from the Nintex SDK :

nwadmin -o FindWorkflows

But – the format (output) of the workflow list is a little tricky to use.   

You simply need to view the lines with “- -“ and “- – – -“ at the start of the line.

image

I have a newer script that writes out ONE line for each workflow – easy when you need to have a definitive “to do” list of SITE workflows, and LIST workflows.

Here’s the new output :

image

This can then be loaded into EXCEL – and sorted.

The script is as follows – just a PowerShelll function that processes the output from the NWADMIN command :

image

If you’d like to use the script – here it is :

function FormatListOfWorkflows
{
    # build the credential object
    $secpasswd = ConvertTo-SecureString $args[1] -AsPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential($args[0],$secpasswd);

    # 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(“– “,””);
            #make sure to NOT have & error
            $list = $list.Replace(“&”, “&”)
        }
        if($line.StartsWith(“—- “))
        {
            $loopCount = $loopCount + 1
            $totalCount = $totalCount + 1

            # get the workflow name
            $workflowname = $line.Replace(“—- “,””);

            #get the workflow – exported
            if($list -eq “Site workflow”)
            {
                $s = “SITE WORKFLOW :       SITE > ” + $site + ”    WORKFLOW > ” + $workflowname
                echo $s
            }
            elseif($list -eq “Reusable workflow template”)
            {
                $s = “REUSABLE WORKFLOW TEMPLATE :       SITE > ” + $site + ”    WORKFLOW > ” + $workflowname
                echo $s
            }
            elseif($list -eq “Site collection reusable workflow template”)
            {
                $s = “SITE COLLECTION REUSABLE WORKFLOW TEMPLATE :       SITE > ” + $site + ”    WORKFLOW > ” + $workflowname
                echo $s
            }
            else
            {
                $s = “LIST WORKFLOW :       SITE > ” + $site + ”    LIST > ” + $workflowname + ”    WORKFLOW > ” + $workflowname
                echo $s
            }
        }
    }
}

$userName = ‘DOMAINusername’
$userPassword = ‘password’

FormatListOfWorkflows $userName $userPassword

 

You could change the text further if you need, perhaps include “|” between columns, and can easily create columns when importing into EXCEL.

Good luck – and happy NINTEX’ing…

🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s