Hi Team,
I needed some help on building the Power Shell script that counts all the workflows created in one particular month using Nintex and SPD separately. Can you please help me with this?
Regards,
Simran Sachdeva
Hi Team,
I needed some help on building the Power Shell script that counts all the workflows created in one particular month using Nintex and SPD separately. Can you please help me with this?
Regards,
Simran Sachdeva
With this script you can list all workflows on a csv file
$siteurl="http://site.domain.com"
$site=Get-SPSite("http://siteName");
#Initialize Workflow Count variable
$workflowcount = 0
#Foreach loop to loop through all webs, and lists with workflow associations, and exclude workflows that have previous versions and write findings to .csv file.
function Get-Workflows()
{
foreach($web in $site.AllWebs)
{
foreach($list in $web.Lists)
{
foreach($wf in $list.WorkflowAssociations)
{
if ($wf.Name -notlike "*Previous Version*")
{
$hash = @{"[url]"=$web.Url;"[List Name]"=$list.Title;"[Workflow]"=$wf.Name}
New-Object PSObject -Property $hash | Sort-Object
}
}
}
}
}
foreach($web in $site.AllWebs)
{
foreach($list in $web.Lists)
{
foreach($wf in $list.WorkflowAssociations)
{
if ($wf.Name -notlike "*Previous Version*")
{
$workflowcount += 1
}
}
}
}
Get-Workflows | Export-csv E:workflows.csv
"Workflow Count " + $workflowcount >> E:workflows.csv
$site.Dispose()
With this script you can list all workflows on a csv file
Take a look to https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.workflow.workflowassociation_members.aspx to filter the information you need.
Thanks for providing the script. This is exactly what i was looking for. Also can you confirm how can we identify whether the workflow was created in SPD or it is Nintex workflow?
Regards,
Simran Sachdeva
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.