During an Active Directory cleanup, I needed to find all tasks which were running with a specific service account. With this query you can easily find your tasks. In our environment, I’ve executed this query with the configuration management tool named SALT. Use the tool which is available in your environment, or just a PowerShell remote session.
1 |
schtasks.exe /query /V /FO CSV | convertfrom-csv | where{$_.'Run as user' -match 'AccoutName'} | select taskname |