Skip to content

Latest commit

 

History

History
100 lines (56 loc) · 5.14 KB

taskservice.md

File metadata and controls

100 lines (56 loc) · 5.14 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
TaskService object
For scripting, provides access to the Task Scheduler service for managing registered tasks.
6ddd43dc-d027-4792-a53b-07fe4d4a3576
TaskService object Task Scheduler
TaskService object Task Scheduler , described
apiref
TaskService
HighestVersion
taskschd.dll
COM
reference
05/31/2018

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