Get all Workflows in a SharePoint Site
Download:
https://drive.google.com/open?id=1Kt0WqtoXV8UxfX7HpFWtj2oMnyXuOgsf
param ([boolean] $writeToFile = $true)
#List all workflows in farm
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #If boolean is set to true, you can specify an outputlocation, to save to textfile.
if($writeToFile -eq $true)
{
$outputPath = Read-Host "Outputpath (e.g. C:directoryfilename.txt)"
}
#Counter variables
$webcount = 0
$listcount = 0
$associationcount = 0
#Grab all webs
Get-SPSite -Limit All | % {$webs += $_.Allwebs}
if($webs.count -ge 1)
{
foreach($web in $webs)
{
#Grab all lists in the current web
$lists = $web.Lists
foreach($list in $lists)
{
$associations = @()
#Get all workflows that are associated with the current list
foreach($listassociation in $list.WorkflowAssociations)
{
$associations += $($listassociation.name)
}
$listcount +=1
if($associations.count -ge 1)
{
Write-Host "Website"$web.url -ForegroundColor Green
Write-Host " List:"$list.Title -ForegroundColor Yellow
foreach($association in $associations){Write-Host " -"$association}
if($WriteToFile -eq $true)
{
Add-Content -Path $outputPath -Value "Website $($web.url)"
Add-Content -Path $outputPath -Value " List: $($list.Title)"
foreach($association in $associations){Add-Content -Path $outputPath -Value " -$association"}
Add-Content -Path $outputPath -Value "`n"
}
}
}
$webcount +=1
$web.Dispose()
}
#Show total counter for checked webs & lists
Write-Host "Amount of webs checked:"$webcount
Write-Host "Amount of lists checked:"$listcount
$webcount = "0"
}
else
{
Write-Host "No webs retrieved, please check your permissions" -ForegroundColor Red -BackgroundColor Black
$webcount = "0"
}
- Home
- Identity, Security, Access
- _Active Directory
- _BitLocker
- _Group Policy
- _SSL Certificates
- Endpoint Management
- _DNS
- _SCCM
- _SCSM
- _Windows
- _Windows Server
- Data, Messaging
- _Exchange
- _SQL Server
- _DocLink
- M365
- _Bookings
- _ClipChamp
- _Engage
- _Forms
- _Lists
- _Loop
- _M365
- _OneDrive
- _OneNote
- _Outlook
- _SharePoint
- _Teams
- _To Do
- _Visio
- _Viva
- _Whiteboard
- Development
- _Javascript
- _Power Apps
- _Power Automate
- _Power BI
- _PowerShell
- Artificial Intelligence
- _AI
- _Copilot

