I recently had an issue where I’ve needed to create move a large and active workflow to write to a new history list.

If the list already exists I can simply point the Workflow to the new list using the GUI. There is an option using the GUI to create a new workflow list, but when it creates the list, it’s based off of the name of the Workflow. So lets say may list hits a million items and I need to create another list. If I use the gui and select create a new workflow list, I’ll get an error that the list name basically already exists.

Using SharePoint Designer I could edit my workflow, create a new list, but then I’d need to republish it to the site. So the easiest method in my particular case, is to simply create a new workflow using PowerShell, then associate the workflow to that new list.

The PowerShell to generate the new list is

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$spweb = Get-SPWeb “http://mysitecollection”
$SPTemplate = $spweb.ListTemplates[“Workflow History”]
$spweb.Lists.Add(“WrkFlowHistoryListName”,”Workflow History List Description”,$SPTemplate)

(761)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.