0

I want to find out all the Nintex workflows exists in my SharePoint 2013 Site collection using Power Shell.

Kindly help me on how to identify the workflow as Nintex workflow using Power Shell.

Thanks

0

Try using below code:

Add-PSSnapin Microsoft.SharePoint.PowerShell

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow")
#[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.SupportConsole")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.Administration")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Forms.SharePoint.Administration")

$cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
$cmd.CommandType = [System.Data.CommandType]::Text
$cmd.CommandText = "SELECT
               COUNT (DISTINCT workflowid)as NumberofWorkflows,
               SiteID,
               WebID,
               listid
FROM WorkflowInstance I inner join WorkflowProgress P
               ON I.InstanceID = P.InstanceID
GROUP BY GROUPING SETS((i.siteid, i.webid, i.listid), ());"

$indexes = @()

foreach ($database in [Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ContentDatabases)
{
    $reader = $database.ExecuteReader($cmd)
    while($reader.Read())
    {
        $row = New-Object System.Object
        if(![string]::IsNullOrEmpty($reader["SiteID"]))
        {
            $Site = $(Get-SPSite -identity $reader["SiteID"])
        }
        if(![string]::IsNullOrEmpty($reader["WebID"]))
        {
            $SubSite = $Site.Allwebs[[Guid]"$($reader["WebID"])"]
        }
        if(![string]::IsNullOrEmpty($reader["ListID"])){
            $List = $SubSite.Lists[[Guid]"$($reader["ListID"])"]
        }
        $row | Add-Member -MemberType NoteProperty -Name "Number Of Workflows" -Value $reader["NumberofWorkflows"]
        $row | Add-Member -MemberType NoteProperty -Name "Site Collection" -Value $Site.Url
        $row | Add-Member -MemberType NoteProperty -Name "Subsite" -Value $SubSite
        $row | Add-Member -MemberType NoteProperty -Name "List" -Value $List.title
        $indexes += $row
    }
}
$indexes

References:

  1. How to locate Nintex Workflows via PowerShell
  2. Finding all of the workflows in your farm using PowerShell
  3. Nintex Workflow - PowerShell Find All Workflows
0

Using the SharePoint site collection UI also, we can get the Nintex workflow details, for that we need to follow the below steps:

  1. Click on the gear icon from the site collection settings.
  2. Click on the Nintex Workflow 2013
  3. Click on the Manage Workflow Inventory

The Manage Workflow Inventory will give you all the Nintex Workflows(both list and site) details. We can export this details to csv.

For more details refer to the below article:

Finding all Nintex Workflows

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.