Skip to main content
Search Again

We think these articles could help you:

    See More
    Nintex Knowledge Base

    Finding Tasks Assigned to Specific User Account

    Status: Validated

    TOPIC
    How to use PowerShell to find tasks assigned to a specific user account in the Workflow Tasks list.
    INSTRUCTIONS
    Use the following script to retrieve a list of assigned tasks:
    $SPWebApp = Get-SPWebApplication {WEB APP URL}
    
    foreach ($SPSite in $SPWebApp.Sites)
    
    {
    foreach ($web in $SPSite.AllWebs)
        { 
        $list = $web.Lists["Workflow Tasks"]
        if ($list.Title -eq "Workflow Tasks")
            {
            $query = New-Object Microsoft.SharePoint.SPQuery 
            $query.Query = "<Where><Contains><FieldRef Name='AssignedTo' LookupId='TRUE' /><Value Type='Lookup'>201</Value></Contains></Where>"
    
            $items = $list.GetItems($query) 
            foreach ($item in $items) 
    
                {
                Write-host $web.Url"/"$item.Url
                } 
            }
        }
    }
    ADDITIONAL INFORMATION
    RELATED LINKS
    • Was this article helpful?