User`s guide

Table Of Contents
The schtasks command returns basic information about scheduled tasks. The data returned by
schtasks includes multiple rows. PowerShell structures the $schtasks variable in an array. For
example, $schtasks[0] represents the first row. To view the result set, use $schtasks[n], which
displays the following status:
n
$schtasks[0] is blank.
n
$schtasks[1] contains column names.
n
$schtasks[2] is the first row of task data.
Prerequisites
n
Review the guidelines to create PowerShell scripts for WCI collections, and understand the challenges in
PowerShell scripting. See "Guidelines in PowerShell Scripting for WCI" on page 94.
n
Understand how to write and run PowerShell scripts. See "References on PowerShell and Script Signing"
on page 98 or the Windows PowerShell online help.
Procedure
1. On your VCM managed Windows machine, click Start.
2. Select All Programs > Accessories > Windows PowerShell.
n
On a 64-bit Windows machine, select Windows PowerShell (x86) to run the 32-bit version of
PowerShell.
n
On a 32-bit Windows machine, select Windows PowerShell.
3. Run the command to set the source of data for the collection script.
$schtasks = schtasks /query /v /fo:csv
The following options are available.
Option Description
/query /v
Displays additional information about scheduled tasks. Be aware
that verbose formatting is difficult for automated processing.
schtasks /query /v
/fo:csv
Displays verbose task output and sets the source of data for the
collection script to a comma-separated value (csv) result set.
schtasks /query /?
Displays additional command options.
4. To return the data to the VCM Collector, parse the data into a structure that is compatible with the
VCM XML format. The sample script parses the data as shown in the following code.
###########################################################################-
##
#
# This inspection script can be used to retrieve scheduled tasks
information
# for tasks created through the Scheduler UI or through the AT command.
#
Getting Started with VCM
VMware, Inc. 99