Vadim Tabakman

Jump to bottom

Today I talked to a customer (Kevin Dunn at DH Pace, Inc.) who had a need to purge some data from the Nintex Workflow History List. The NWAdmin tool helps with purging data from the Nintex Workflow history lists and there's also a way to do it through the Manage History Lists page in Site Settings.

Where we hit a bit of a limitation, is that these only support purging data from a single site at a time. When you have many sites, there's no simple way to do it. You need to script it. This is especially true if you want it part of a maintenance schedule. Hard coding site urls is not really an option because if you create new sites, you'll need to update your maintenance scripts.

This partner came up with a great idea, of scripting the purge via PowerShell. The following is a PowerShell script that takes a base url to a site in a Site Collection, and then recursively goes through each subsite and runs the purge.

The one this to notice about the scripts below, is that they are hardcoded to purge history data older than 2000 days. You would need to tweak it to purge what you need. It is also hardcoded to a fake url, so you would need to update the first like with the proper url, or even better, put it in as a command line parameter.

Firstly, let's start with which product do your want to see? Click the appropriate link below

|

Nintex Workflow 2013
In Nintex Workflow 2013, the NWAdmin tool exists in the hive bin. So we don't need to put in a url to it. It should be available from the Management Shell.
$web = get-spweb http://mysiteurl

function PurgeHistoryListData( $w )
{
    $ws = $w.Webs;
    foreach( $subweb in $ws)
    {
        PurgeHistoryListData($subweb)
    }
    Write-Host 'Purging Nintex Workflow History List Data on site : '$w.Url

    & 'nwadmin.exe' -o PurgeHistoryListData -siteUrl $w.Url -days 2000 -silent
}

Write-Host 'Purging Nintex Workflow History List Data on site : '$web.Url
PurgeHistoryListData $web
Conclusion
 
I hope this helps someone, because it definitely helped me today.
 
Posted by Vadim Tabakman Wednesday, December 19, 2012 2:17:00 PM Categories: Nintex Nintex Workflow Nintex Workflow 2013 PowerShell
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Tuesday, March 19, 2013 6:13:01 AM
Deepesh Yevle

re: Nintex Workflow - Purge History List Data for a Site Collection

HI,

i have a problem in my server , the workflow association id and item id missing or not match , may be association or item id , so how can we use on this more then 1 year. 

Monday, April 1, 2013 10:08:40 AM

re: Nintex Workflow - Purge History List Data for a Site Collection

Great post. I was checking constantly this blog and I'm impressed! Very helpful info particularly the last part :) I care for such information a lot. I was seeking this certain info for a long time. Thank you and good luck.

Monday, April 1, 2013 10:13:48 AM

re: Nintex Workflow - Purge History List Data for a Site Collection

Hi Deepesh,

I'd look at the NWAdmin -o PurgeHIstoryListData operation.  I believe there's a -deletedItems parameters.  Maybe that would help.

Thursday, October 3, 2013 5:38:51 AM
Adeboye Osomo

re: Nintex Workflow - Purge History List Data for a Site Collection

Hi Vadim,

 

I performed this action a while ago to clean up the NintexWorkflowHistory list. It appeared to have deleted some workflow task list items as well - though not sure of this. I now have a seperate problem where I cannot find some completed workflow task list items in workflow task.

When looking at the actual workflow history on "View Workflow history". The task history is visible, so I beleieve it is still somewhere accessible.

I am doing some audit reports on the specified workflow task list and I need to be able to get all completed tasks on the list.

 

Do you know of a way to restore this deleted data back in the workflow task list?

Thursday, October 3, 2013 8:20:38 AM

re: Nintex Workflow - Purge History List Data for a Site Collection

HI Adeboye,

I don't know of any way to restore the data to a list, other than a database restore.

The PurgeHIstoryListData shouldn't have removed any tasks.  I don't believe that is part of the functionality, but you could contact support@nintex.com to confirm.

cheers,

Vadim

Thursday, April 23, 2015 1:07:16 AM
SPNick
Gravatar

re: Nintex Workflow - Purge History List Data for a Site Collection

Hi, Vadim. Looks like this script purge SharePoint history List only. But I need to clean up DB table too. Can you say something about it?

URL to my full question is https://community.nintex.com/thread/3267

I have a big problem with it.

Thursday, April 23, 2015 7:11:33 AM

re: Nintex Workflow - Purge History List Data for a Site Collection

HI SPNick,

you're on the right track, but I would suggest you run the NWAdmin command line tool on it's own, rather than through a PowerShell script, using the -o PurgeWorkflowData operation and see if it works.

cheers,

Vadim

Tuesday, April 28, 2015 1:29:28 AM
SPNick
Gravatar

re: Nintex Workflow - Purge History List Data for a Site Collection

Thank you Vadim! It helped me. But now I have another trouble with history table. Can you check my topic once more?

(community.nintex.com/thread/3267)

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





 

Statistics

  • Entries (235)
  • Comments (1721)

Categories