We run nwadmin -o delegatealltasks every month on users that have left the organisation, like so:
nwadmin -o delegatealltasks -currentuser mydomain\jsmith -newuser mydomain\sjones -siteurl http://webserver/sites/documentmanagement -sendnotification -username administrator -password mysecret -domain mydomain
Usually, the script returns without any errors. This time round, however, hundreds of errors are returned. They fall in one of three categories:
1> Failed to delegate task for task ID 2857 associated with workflow 'WF-DocumentApproval' on item 1190 in list 'Document Register' on site 'http://webserver/sites/documentmanagement': Value cannot be null.
2> Failed to delegate task for task ID 7989 associated with workflow 'WF-DocumentApproval-Upload' on item 2795 in list 'Document Register' on site 'http://webserver/sites/documentmanagement': Cannot find item with id 2795 in list 'Document Register'. Check the user has at least read permissions. Current user: COBS\administrator.
3> Failed to delegate task for task ID 4734 associated with workflow 'WF-DocumentApproval-Edit' on item 788 in list 'Document Register' on site 'http://webserver/sites/documentmanagement': Value does not fall within the expected range.
None of the tasks reported are visible in any views, but they must still be in the database so I suspect nwadmin -o delegatealltasks still picks them up, but then finds out they are orphaned (i.e. no related items in the document library are found). Our site collection administrator emptied the site collection level recycling bin, and reran nwadmin but with no difference.
Is this a bug in nwadmin -o delegatealltasks?