Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

hi guys i need a help to get easy way to delete work flow from sub site level . its a pain to load it to SPD and do for there since site have lot of work flows .

this Poweshell i got the work flow details .

$site = Get-SPSite "SITEURL"; $site.AllWebs | foreach { $.Lists | foreach { $.WorkflowAssociations | foreach { write-host "Site:" $.ParentWeb.Url ", List:" $.ParentList.Title ", Workflow:" $_.Name } } }

any help is welcome.

Cheers

share|improve this question

1 Answer 1

To remove all Workflow Associations in a Site Collection you can do something like:

(Get-SPSite http://sp2010).AllWebs |
  Foreach-Object {
    $wfas = ($_.Lists |
             Select-Object -Expand WorkFlowAssociations | 
             Select-Object Id, ParentList);
    $wfas |
      Foreach-Object {
        if ($_ -ne $null) {
          $_.ParentList.WorkflowAssociations.Remove($_.Id)
        }
      }
  }
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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