Workfloow inventrory from SharePoint farm

sns 9,226 Reputation points
2023-02-07T17:00:15.28+00:00

Workfloow inventrory from SharePoint farm, like I would like to know list of workflows from entire farm, also who published the workflow last, is there any way to get this data, please suggest.

We are having SharePoint designer and also Nintex workflows.

I know Nintex is 3rd party but we just need to get the inventory report of all workflows ( MS Designer and Nintex ) interms of who published, workflow name and associated list/site.

and result should be exported to CSV.

Thank you in Advance.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,214 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
507 questions
0 comments No comments
{count} votes

Accepted answer
  1. AllenXu-MSFT 15,926 Reputation points Microsoft Vendor
    2023-02-08T02:55:29.2866667+00:00

    Hi @sns,

    This script iterates through all site collections-sites-List objects to fetch workflow data such as: Workflow Name, Running instances. I'm afraid the users who published the workflow cannot be fetched.

    
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
     
    Function global:Get-SPWebApplication($WebAppURL)
    {
     return [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($WebAppURL)
    }
     
    #Function to Get the workflow inventory for the entire web application
    function Get-WorkflowInventory([string] $WebAppURL)
    {
        #Get the Web Application URL
        $WebApp = Get-SPWebApplication $WebAppURL 
      
        #Iterate through each site collection
        foreach ($Site in $WebApp.Sites)
              {                             
                    #Loop through each site    
                    foreach ($Web in $Site.AllWebs)
                       {
                        #Loop through each list
                        foreach ($List in $Web.Lists)
                          {
                             # Leave hidden Lists and Libraries
                             if($List.Hidden -eq $false)
                             {
                                foreach ($WorkflowAssociation in $List.WorkflowAssociations)
                                {
                                    #Leave the "Previous Versions"
                                    if($WorkflowAssociation.Name.Contains("Previous Version") -eq $false)
                                        {
                                           $data = @{
                                            "Site" = $Site.Rootweb.Title
                                            "Web" = $Web.Title
                                            "Web URL" = $Web.Url
                                            "List Name" = $List.Title
                                            "List URL" =  $Web.Url+"/"+$List.RootFolder.Url
                                            "Workflow Name" = $WorkflowAssociation.Name
                                            "Running Instances" = $WorkflowAssociation.RunningInstances
                                            }
                                             
                                            #Create an object
                                            New-Object PSObject -Property $data
                                        }
                                  }
                              }                   
                        }
                         $Web.Dispose()                 
                    }
                    $Site.Dispose()                  
        }
    }
     
    #call the function
    Get-WorkflowInventory "https://sharepoint.crescent.com" | Export-Csv -NoTypeInformation -Path D:\Reports\WorkflowInventory.csv
     
    write-host "Workflows Inventory report has been generated successfully!"
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful