Subscribe to Windows IT Pro
December 05, 2008 12:00 AM

Script Gathers Scheduled Task Information

Windows IT Pro
InstantDoc ID #100969
Rating: (1)
Downloads
100969.zip

System administrators often need to gather scheduled task information. To accommodate this need, Jim Turner has written GetSchTasks.vbs. This script uses Schtasks.exe—the command-line interface for Task Scheduler—to gather scheduled task data from all the computers in a given organizational unit (OU).

GetSchTasks.vbs uses the WScript.Shell object in Windows Host Script (WSH) to run Schtasks.exe. For each computer in the OU, the script writes the scheduled task data to a .csv file. The script then writes the data in all the .csv files to a Microsoft Excel spreadsheet.

Although this script works well with Windows XP, Windows Server 2003, and Windows 2000, there are multiple headers interspersed in the output when you use it with Windows Vista and Windows Server 2008. This is due to a glitch that occurs when schtasks.exe is used with Vista and Server 2008. Microsoft is aware of this glitch.

To use GetSchTasks.vbs, your machine needs to be running Windows Management Instrumentation (WMI), WSH, and Excel. You can download the script by clicking the Download the Code Here button at the top of the page. The utility will be available for download indefinitely, so you can download it today, next week, next month, or even next year should you happen to misplace it.

After you download GetSchTasks.vbs, you need to create a folder to house it. In the script, you must customize the QStr variable so that it points to your target OU.

Related Content:

ARTICLE TOOLS

Comments
  • Kenny
    3 years ago
    Nov 05, 2009

    i dont get any headers i the ExcelSheets.
    Anyone els having the same problem?

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.