Posts

Showing posts from February, 2018

Remove all workflows using PowerShell

The below script will help to delete all workflows from all sites in a single shot. param([string]$SiteURL) $site=Get-SPSite($SiteURL); foreach($web in $site.AllWebs) {       Write-Host "Web Title: "$web.Title       $listColl = $web.Lists;       for($itr1=0; $itr1 -lt $listColl.Count; $itr1++)      {           $list = $listColl[$itr1];           $wfColl = $list.WorkflowAssociations;           if($wfColl.Count -gt 0)          {               Write-Host "List Title: "$list.Title;          }          for($itr2=$wfColl.Count-1; $itr2 -ge 0; $itr2--)         {             $wf = $wfColl[$itr2];             $list.RemoveWorkflowAssociation($wf);        ...