We are running MOSS SharePoint 2007. There is a v1 install of PowerShell on the Windows 2003 server for the farm.
There are several types of workflows within SharePoint 2007.
- There are the out of the box workflows that one can construct without code.
- There are the SharePoint Designer 2007 workflows that one can construct without code
- There are the C# Visual Studio workflows that one can code and deploy
- There are third party workflows (Nintex, AgilePoint, K2, etc.) that one can code or construct after installing the various pieces.
- There may be some other ways of which I am forgetting.
What I need to be able to do is to create an inventory, for each site collection, of the URLs of the workflows that exist within the site collection.
Someone in an msdn sharepoint forum thread recently suggested that the following powershell code would display the information I was seeking:
$siteCollectionUrl ="Your Site Collection URL"
$site =new-objectMicrosoft.SharePoint.SPSite($siteCollectionUrl)
foreach($web in $site.AllWebs)
{
$listToCheck ="List Name"
foreach($list in $web.Lists)
{
if($list.Title-eq $listToCheck)
{
write-host "List Title -->" $list.Title
foreach($wf in $list.WorkFlowAssociations)
{
write-host "Workflow -->" $wf.Name
}
}
}
}
$web.Dispose()
$site.Dispose()
However, when I executed the above code, I did not get anything output.
I have been reading various blog articles, etc. to learn more about PowerShell, but so far, I have not figured out how to change the above code so that I either get information about the workflows, or errors telling me why I am not getting information.
Can anyone help me understand better how to tweek this code so that it provides me information about the workflows?
Thank you!