Stay on Schedule
Need to keep track of all your network's scheduled tasks? Here's just the tool to do it.
- By Jeffery Hicks
One of the most incredible things -- or one of the scariest, depending on your
point of view -- is that there's always something happening on your network.
Even in the middle of the night, while you're dreaming of 64-bit servers and
four-way clusters, your servers are quietly churning away doing something. The
question is: Do you know what's going on?
If your network is like most that I've seen, you've set up some scheduled tasks
on a number of servers over the years, but never really got around to documenting
what they do or when they run. You may even have applications that set up scheduled
tasks and don't tell you about it.
I've put together an HTML application (HTA) that will generate a report of
all scheduled tasks running on your servers and/or desktops. Mr. Roboto's Scheduled
Task Reporter serves as a GUI front-end for the Schtasks.exe command-line utility
that ships with Windows XP and Windows 2003.
As such, you'll have to run it from an XP desktop or Windows 2003 server. Microsoft
has indeed improved scheduled task support in Vista, but unfortunately this
tool won't detect scheduled tasks on a Vista desktop. You might be able to scan
your servers from a Vista desktop, but you shouldn't count on it. Keep your
eyes out for something similar for Vista in the future.
For now, you're probably most interested in what your servers are doing and
when they're doing it. The Scheduled Task Reporter should work fine for that
task. After you copy all the files to a directory, launch the HTA file. You'll
have to run this tool with administrator credentials. You can specify alternate
credentials for any managed systems you're polling for task data, but not for
the system on which you're running the tool.
To run Scheduled Task Reporter, simply select "computername," "text
file" or "Active Directory" from the drop-down box. Selecting
"computername" defaults you to the local computer, but you can type
in any computer name you want. All you need is the NETBios name. You can also
enter several computer names separated by commas.
If you choose the text file option, you can use a text file that contains a
columnar list of computer names that might look like this:
If the file isn't in the same directory as the HTA, enter the full filename
and path. I've included an option to search Active Directory for computer accounts.
If your computer belongs to a domain, the root distinguished name will be pre-populated.
All you have to do is add the organizational unit path.
If you're going to query AD, then you should do so with caution. If you have
a lot of obsolete computer accounts or systems that aren't available, you'll
get incomplete results and it will take a long time to generate the report.
I strongly recommend that you use the Ping option to verify that any computer
is up and running before you try to poll it for any scheduled task information.
Once you have your source, click "Report" and the tool will check
each computer for scheduled tasks. If all goes well, you should get an entry
for each scheduled task that shows the task name, command, its schedule, credentials,
last run and next run times.
You can hover your mouse pointer over the last run entry in order to see the
last result. If your task has an attached comment, it will show it if you hover
your mouse over the task description. It will also report any errors and any
systems with no assigned tasks. Finally, use the Print button and file the report
away with your network documentation. I also like to print a copy to PDF for
fast digital retrieval.
Now there's no reason for you to not know what your servers are doing in the
middle of the night, and you'll sleep much better. Pleasant dreams.
Jeffery Hicks is a Microsoft MVP in Windows PowerShell, Microsoft Certified Trainer and an IT veteran with over 20 years of experience, much of it spent as an IT consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He works today as an independent author, trainer and consultant. Jeff writes the popular Prof. PowerShell column for MPCMag.com and is a regular contributor to the Petri IT Knowledgebase and 4SysOps. If he isn't writing, then he's most likely recording training videos for companies like TrainSignal or hanging out in the forums at PowerShell.org. Jeff's latest books are Learn PowerShell 3 in a Month of Lunches, Learn PowerShell Toolmaking in a Month of Lunches and PowerShell in Depth: An Administrators Guide.
You can keep up with Jeff at his blog http://jdhitsolutions.com/blog, on Twitter at twitter.com/jeffhicks and on Google Plus (http:/gplus.to/JeffHicks)