0

I can use powershell to get the names of all SharePoint Designer workflows in my farm - but is there a way to look at the steps of the workflow?

Specifically, this farm has the iLoveSharePoint.Workflow.Activities solution installed and I want to find all workflows that utilize any of those custom activities.

(I have another farm that uses Virto custom workflow activities too and will need similar info on it later)

This is for SharePoint 2010

0

You can download xoml file. It contains information about all activities. Example (without parsing for list activities):

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Function GetXOMLFromWorkflowInstance($wfa)
{
    [xml]$xmldocument =  $wfa.SoapXml
    $name = $xmldocument.FirstChild.GetAttribute("Name")
    $wfName = $name.Replace(" ", "%20")
    $webRelativeFolder = "Workflows/" + $wfName
    $xomlFileName = $wfName + ".xoml"

    $wfFolder = $wfa.ParentWeb.GetFolder($webRelativeFolder)

    $xomlFile = $wfFolder.Files[$xomlFileName]
    if ($xomlFile.Exists)
    {
        $xomlStream = $xomlFile.OpenBinaryStream()
        $xmldocument.Load($xomlStream)
        $xomlStream.Close()

        return $xmldocument.OuterXml
    }

    return $xomlFileName
}

Function LoadAllWFXoml ($webUrl, $listName)
{
    $site = Get-SPSite($webUrl)
    $web = $site.OpenWeb()
    $wfaColl = $web.GetList($listName).WorkflowAssociations

    Foreach ($i in $wfaColl)
    {
        $xml = GetXOMLFromWorkflowInstance $i
        Write-Host $xml
        Write-Host "=============================="
    }
}

LoadAllWFXoml "http://site_url" "Lists/MyList"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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