Vadim Tabakman

Jump to bottom

This is Part 5 from the previous post on PowerShell Find Workflows that contain a Specific Action Part 4.

Added a new operation that looks in all the workflows to find those that have Verbose Logging enabled.

Operation is : FindVerboseLogging

Changes to the PowerShell Script

The way to export and publish a workflow is via a web service call to the site where the workflow lives. The Nintex Workflow web service url looks like this :

http://[siteurl]/_vti_bin/NintexWorkflow/Workflow.asmx

You can find some more information about this web service in the Nintex Workflow 2010 SDK.

I've added a new operation named "FindVerboseLogging". What this script does, is it finds each workflow from the NWAdmin command, then connects to the web service running on that site and makes a call to the ExportWorkflow web method, and then it runs some Regular Expression over the exported workflow, to interrogate it and find out whether the workflow has Verbose Logging enabled.

How to run this PowerShell Script

Put the script file in to : c:\Program Files\Nintex\Nintex Workflow 2010

To run this script, open the SharePoint 2010 Management Shell.

Change directories to c:\Program Files\Nintex\Nintex Workflow 2010

Run the script to Find Workflows with an Action:

.\AllWorkflows.ps1 -nwoperation FindWorkflowsWithAction -nwlogin domain\username -nwpassword password -nwaction "actionname"

eg. to find all the workflows that contain the Math operation action

.\AllWorkflows.ps1 -nwoperation FindWorkflowsWithAction -nwlogin domain\username -nwpassword password -nwaction "Math operation"

Run the script to Export:

.\AllWorkflows.ps1 -nwoperation ExportAll -nwlogin domain\username -nwpassword password

Run the script to Republish:

.\AllWorkflows.ps1 -nwoperation RepublishAll -nwlogin domain\username -nwpassword password

Run the script to Find Workflows with Verbose Logging Enabled:

.\AllWorkflows.ps1 -nwoperation FindVerboseLogging -nwlogin domain\username -nwpassword password

Output

The output of this script call will be:

[siteurl] - [listname] - [workflowname]

This should be enough to get you to your workflow.

Conclusion

You should now be able to find which workflow contains a verbose logging.

Don't be afraid to tweak this to add more features that you may need.

If you find that you get timeouts (eg. publishing large worfklows), there is a -nwtimeout parameter you can use to increase the timeout.

Notes

19th Feb 2014 (v4.4) - add find verbose logging.

29th Aug 2012 (v4.3) - add better support for parameters and web service timeout.

28th Aug 2012 (v4.2) - add support for Site Workflow, Reusable Workflow Templates and Site Collection Reusable Workflow Templates.

This script has not been tested with FBA or CBA.

28th Aug 2012 (v4.1) - I added some more error handling to this script. It will now stop the script on the first exception it gets, and it will output the web service url, the list and the workflowname. I've also added a line to accept SSL certificates. I have tested this with an SSL site, but only one. Let me know if you find anything.

If you come across an exception, and you want to test this out for a single specific site/list/workflow, then you can try this script. But you will need to type in the login, password, webservice url, list and workflowname:

try
{
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

$login = "";
$password = "";
$webserviceurl = "";
$list = "";
$workflowname = "";

$secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($login,$secpasswd);
$webserviceurl = $webserviceurl
$page = New-WebServiceProxy -Uri $webserviceurl -Credential $credential;
$page.Url = $webserviceurl;
$exportedworkflow = $page.ExportWorkflow($workflowname,$list,'List');
$publishresult = $page.PublishFromNWFXml($exportedworkflow,$list,$workflowname,$True);
}
catch
{
echo $_;
}

Downloads

Posted by Vadim Tabakman Tuesday, February 19, 2013 10:30:00 AM Categories: Nintex Nintex Workflow PowerShell Verbose Logging
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Wednesday, May 29, 2013 3:36:55 AM
Laura Blackmore

re: Nintex Workflow - PowerShell Find Workflows with Verbose Logging Enabled Part 5

Awesome! Thanks mate. I was just looking for exactly this :D

Sunday, January 12, 2014 5:00:41 PM
Robyn Dennis

re: Nintex Workflow - PowerShell Find Workflows with Verbose Logging Enabled Part 5

Thanks Vadim. This is brilliant and saved me heaps of time. 

Love your work. :-)

 

Tuesday, May 13, 2014 6:12:19 AM
Greppo Mettes
Gravatar

re: Nintex Workflow - PowerShell Find Workflows with Verbose Logging Enabled Part 5

Thanks for this beautiful series Vadim. I just have a little question: is it possible to SET (disable) verbose logging with PowerShell? Otherwise I'll have to disable +- 1000 Nintex workflow, each once a time. 

King regards,

Greppo

 

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register
  • RSS





 

Statistics

  • Entries (239)
  • Comments (1722)

Categories