TaskService object

For scripting, provides access to the Task Scheduler service for managing registered tasks.

The TaskService.Connect method should be called before calling any of the other TaskService methods.

Members

The TaskService object has these types of members:

Methods

The TaskService object has these methods.

Method Description
Connect Connects to a remote machine and associates all subsequent calls on this interface with a remote session.
GetFolder Gets the path to a folder of registered tasks.
GetRunningTasks Gets a collection of running tasks.
NewTask Returns an empty task definition object to be filled in with settings and properties and then registered using the TaskFolder.RegisterTaskDefinition method.

Properties

The TaskService object has these properties.

Property Description
Connected
Gets a Boolean value that indicates if you are connected to the Task Scheduler service.
ConnectedDomain
Gets the name of the domain to which the TargetServer computer is connected.
ConnectedUser
Gets the name of the user that is connected to the Task Scheduler service.
HighestVersion
Gets the highest version of Task Scheduler that a computer supports.
TargetServer
Gets the name of the computer that is running the Task Scheduler service that the user is connected to.

Examples

For more information and example code for this scripting object, see Time Trigger Example (Scripting), Event Trigger Example (Scripting), Daily Trigger Example (Scripting), Registration Trigger Example (Scripting), Weekly Trigger Example (Scripting), Logon Trigger Example (Scripting), Boot Trigger Example (Scripting), or Displaying Task Names and States (Scripting).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Type library
Taskschd.tlb
DLL
Taskschd.dll

See also

Task Scheduler