SharePoint 2013 place holder

SharePoint Powershell , Get all site workflows by list

This PowerShell Script returns all sites that have a list with workflows. It pipes to an output file named output.txt

$webApp=Get-SPWebApplication
"Powershell script by Jeremy @ <a href="http://www.BondByte.com">http://www.BondByte.com</a>" | Out-File output.txt
" "  | Out-File output.txt -append
   # Get All site collections
    foreach ($SPsite in $webApp.Sites)
    {
       # get the collection of webs
       foreach($SPweb in $SPsite.AllWebs)
        {
        foreach($SPList in $SPweb.Lists)
        {
        if ($SPList.WorkflowAssociations.Name)
                {
                "List Name: " + $SPList.Title | Out-File output.txt -append
                "Workflow Name: " + $SPList.WorkflowAssociations.Name | Out-File output.txt -append
                "Site URL: " + $SPWeb.Url | Out-File output.txt -append
                " " | Out-File output.txt -append
                }
        }
        }
     }

About the author

Leave a Reply