I’m trying to get information from all Scheduled tasks, I heard there was a new Scheduled task inspector coming out soon…
in the mean time I looking for information like who the task “runs as”, because were changing passwords and I need to see if there are any tasks running as that user
when I use WMI it only seems to gather information on AT commands and not standard tasks
Im running Client version 7.2.5.22 and the latest server and consoles
I’ve got some bad news… it can’t be done with relevance alone. In fact, there is no way to query these values in Windows without using a VBScript (beginning with Windows Vista) or the schtasks Command Line utility.
You could create a BigFix task that outputs the results of an schtasks /Query command to a text file. You could then use relevance to parse that text file. It’s not elegant, but it should work.
This is a bit ghetto, but one thing I do is I create the scheduled task with BigFix and give it a name with the date in it. The relevance for the task has that file name, so it knows not run again on that machine. If I want to go back and change it, I just kill that schedule task and create a new one with a new BigFix task. Obviously this doesn’t help if you already have existing tasks out there that you want to inspect-- Boyd’s suggestion would be your best bet then.
to get the same results on Windows 2000, because 2000 does not have schtasks, and the one from XP only works on XP and 2003
if
{(not exists (pathname of windows folder &
"\System32\schtasks.exe")) and (not exists (name of drive of windows folder &
"\Program Files\Resource Kit\schtasks.exe"))
} prefetch schtasks.exe sha1:e1643645db2c6a17685a8c3e9763100911c8e398 size:121856 http:
//MYBESSERVER.COM/Shared/Component_Install/SCHTASKS_Win_2000/schtasks.exe copy __download\schtasks.exe
{pathname of windows folder
}\System32\schtasks.exe endif DOS
{pathname of windows folder
}\System32\SCHTASKS.EXE /QUERY /FO CSV /V >
{pathname of windows folder
}\SCHTASKS.TXT
than gather it with a analysis
(All tasks run as 1 user account)
if exists file ((pathname of windows folder) &
"\SCHTASKS.TXT") then lines whose (it as lowercase contains
"<YOUR USER>") of file ((pathname of windows folder) &
"\SCHTASKS.TXT")
else
"<Tasks not available>"
(All Tasks)
if exists file ((pathname of windows folder) &
"\SCHTASKS.TXT") then lines whose (it contains computer name) of file ((pathname of windows folder) &
"\SCHTASKS.TXT")
else
"<Tasks not available>"
this way if he file is not present it displays “” and if its empty it displays “”
otherwise it displays a comma delimited list of all tasks