Microsoft.Win32.TaskScheduler Namespace

The Microsoft.Win32.TaskScheduler namespace provides a wrapper for the 1.0 and 2.0 versions of Task Scheduler found in all Microsoft operating systems post Windows 98. It will automatically choose the most recent version of the library found on the host system. The namespace includes classes for direct manipulation of the Task Scheduler as well as UI items to allow users to manipulate tasks.

Classes

Action Abstract base class that provides the common properties that are inherited by all action objects. An action object is created by the AddNew(TaskActionType) method.
ActionCollectionCollection that contains the actions that are performed by the task.
ActionEditDialogAn editor that handles all Task actions.
BootTriggerRepresents a trigger that starts a task when the system is booted.
ComHandlerAction Represents an action that fires a handler. Only available on Task Scheduler 2.0.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.
ComObjectSelectionDialogDialog that will enumerate and display a list of COM objects and allow for a single selection.
CorrelatedTaskEvent Historical event information for a task.
CorrelatedTaskEventEnumerator An enumerator over a task's history of events.
CorrelatedTaskEventLog Historical event log for a task. Only available for Windows Vista and Windows Server 2008 and later systems.
CustomComboBoxCustomComboBox is an extension of ComboBox which provides drop-down customization.
CustomTrigger Represents a custom trigger. This class is based on undocumented features and may change.

  Note

This type of trigger is only available for reading custom triggers. It cannot be used to create custom triggers.
DailyTrigger Represents a trigger that starts a task based on a daily schedule. For example, the task starts at a specific time every day, every other day, every third day, and so on.
DropDownCheckListA check list in a drop down combo box.
DropDownCheckTree A check list in a drop down combo box.
EmailAction Represents an action that sends an e-mail.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.

  Caution

This action has been deprecated in Windows 8 and later. However, this library is able to mimic its functionality using PowerShell if the PowerShellConversion property is set to All. To disable this conversion, set the value to Never.
EventActionFilterEditorDialog that enables editing of event queries, specifically for creating filters.
EventTrigger Represents a trigger that starts a task when a system event occurs.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.
EventViewerDialog Dialog allowing the viewing of a task event.
ExecActionRepresents an action that executes a command-line operation.
FullDateTimePickerA single control that can represent a full date and time.
IdleSettings Specifies how the Task Scheduler performs tasks when the computer is in an idle condition. For information about idle conditions, see Task Idle Conditions.
IdleTrigger Represents a trigger that starts a task when the computer goes into an idle state. For information about idle conditions, see Task Idle Conditions.
ListColumnEditor Dialog allowing the selections of columns for a list.
ListControlItemAn item in a ListControl.
LogonTrigger Represents a trigger that starts a task when a user logs on. When the Task Scheduler service starts, all logged-on users are enumerated and any tasks registered with logon triggers that match the logged on user are run. Not available on Task Scheduler 1.0.
MaintenanceSettingsSpecifies the task settings the Task scheduler will use to start task during Automatic maintenance.
MonthlyDOWTrigger Represents a trigger that starts a task on a monthly day-of-week schedule. For example, the task starts on every first Thursday, May through October.
MonthlyTrigger Represents a trigger that starts a job based on a monthly schedule. For example, the task starts on specific days of specific months.
NamedValueCollection Contains a collection of name-value pairs.
NameValuePair Pair of name and value.
NetworkSettingsProvides the settings that the Task Scheduler service uses to obtain a network profile.
NotSupportedPriorToException Thrown when the calling method is not supported by Task Scheduler versions prior to the one specified.
NotV1SupportedException Thrown when the calling method is not supported by Task Scheduler 1.0.
NotV2SupportedException Thrown when the calling method is not supported by Task Scheduler 2.0.
RegistrationTrigger Represents a trigger that starts a task when the task is registered or updated. Not available on Task Scheduler 1.0.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.
RepetitionPatternDefines how often the task is run and how long the repetition pattern is repeated after the task is started.
ResourceReferenceValue Some string values of TaskDefinition properties can be set to retrieve their value from existing DLLs as a resource. This class facilitates creating those reference strings.
RunningTaskProvides the methods to get information from and control a running task.
RunningTaskCollection Collection of running tasks in a TaskService. This class has no public constructor and can only be accessed via the properties and functions within TaskService.
SessionStateChangeTrigger Triggers tasks for console connect or disconnect, remote connect or disconnect, or workstation lock or unlock notifications.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.
ShowMessageAction Represents an action that shows a message box when a task is activated.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.

  Caution

This action has been deprecated in Windows 8 and later. However, this library is able to mimic its functionality using PowerShell if the PowerShellConversion property is set to All. To disable this conversion, set the value to Never.
SnapshotItemAbstract class representing a secured item for storage in a TaskSchedulerSnapshot.
Task Provides the methods that are used to run the task immediately, get any running instances of the task, get or set the credentials that are used to register the task, and the properties that describe the task.
TaskAccessRule Represents a set of access rights allowed or denied for a user or group. This class cannot be inherited.
TaskAuditRule Represents a set of access rights to be audited for a user or group. This class cannot be inherited.
TaskBrowserDialog A dialog for selecting tasks or task folders.
TaskCollection Contains all the tasks that are registered within a TaskFolder. This class has no public constructor and can only be accessed via the properties and functions within TaskFolder.
TaskCompatibilityEntryContains information about the compatibility of the current configuration with a specified version.
TaskDefinitionDefines all the components of a task, such as the task settings, triggers, actions, and registration information.
TaskEditDialogDialog that allows tasks to be edited
TaskEnumGlobalizer Functions to provide localized strings for enumerated types and values.
TaskEvent Historical event information for a task. This class wraps and extends the EventRecord class.
TaskEventEventDataValues Get indexer class for EventLogRecord data values.
TaskEventArgs Information about the task event.
TaskEventEnumerator An enumerator over a task's history of events.
TaskEventLog Historical event log for a task. Only available for Windows Vista and Windows Server 2008 and later systems.
TaskEventWatcher Watches system events related to tasks and issues a EventRecorded event when the filtered conditions are met.

  Note

Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.
TaskEventWatcherEventFilter Holds filter information for a TaskEventWatcher.
TaskFolder Provides the methods that are used to register (create) tasks in the folder, remove tasks from the folder, and create or remove subfolders from the folder.
TaskFolderCollectionProvides information and control for a collection of folders that contain tasks.
TaskFolderSnapshotRepresents a TaskFolder instance and captures its name and security.
TaskHistoryControl Split-panel that displays a list of all events associated with a task with a hidable detail pane.
TaskListView Displays a TaskCollection in a ListView control. Mimics list in MMC.
TaskListViewTaskSelectedEventArgs Event args for when a task is selected.
TaskOptionsEditorDialog that allows tasks to be edited
TaskPrincipal Provides the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal.
TaskPrincipalPrivileges List of security credentials for a principal under version 1.3 of the Task Scheduler. These security credentials define the security context for the tasks that are associated with the principal.
TaskPrincipalPrivilegesTaskPrincipalPrivilegesEnumeratorEnumerates the privileges set for a principal under version 1.3 of the Task Scheduler.
TaskPropertiesControlControl which allows for the editing of all properties of a TaskDefinition.
TaskPropertiesControlComponentErrorEventArgsError thrown within the component.
TaskRegistrationInfo Provides the administrative information that can be used to describe the task. This information includes details such as a description of the task, the author of the task, the date the task is registered, and the security descriptor of the task.
TaskRunTimesControlControl that will display the run times for a provided task.
TaskRunTimesDialog Dialog that will display the run times for a provided task.
TaskSchedulerSnapshot Represents all the information about the tasks and folders from a TaskService instance that can be used to reconstitute tasks and folders on the same or different systems.

  Note

This class and related classes are only available under the .NET 4.5.2 build and later .NET versions due to dependencies on threading and compressed (zip) files.
TaskSchedulerWizard A wizard that walks the user through the creation of a simple task.
TaskSecurity Represents the Windows access control security for a Task Scheduler task. This class cannot be inherited.
TaskServiceProvides access to the Task Scheduler service for managing registered tasks.
TaskServiceConnectDialog Dialog box to set the properties of a TaskService.
TaskServiceExtensionsExtension methods for TaskService.
TaskServiceVersion Known versions of the native Task Scheduler library. This can be used as a decoder for the HighestSupportedVersion and LibraryVersion values.
TaskSettingsProvides the settings that the Task Scheduler service uses to perform the task.
TaskSnapshotRepresents a Task instance and captures its details.
TextValueItemTA generic text/value class.
TimeTriggerRepresents a trigger that starts a task at a specific date and time.
Trigger Abstract base class which provides the common properties that are inherited by all trigger classes. A trigger can be created using the AddTTrigger(TTrigger) or the AddNew(TaskTriggerType) method.
TriggerCollectionProvides the methods that are used to add to, remove from, and get the triggers of a task.
TriggerEditDialogAn editor that handles all Task triggers.
TSNotSupportedException Abstract class for throwing a method specific exception.
WeeklyTrigger Represents a trigger that starts a task based on a weekly schedule. For example, the task starts at 8:00 A.M. on a specific day of the week every week or every other week.
Wildcard Represents a wildcard running on the System.Text.RegularExpressions engine.

Structures

TaskServiceConnectionToken Represents a valid, connected session to a Task Scheduler instance. This token is thread-safe and should be the means of passing information about a TaskService between threads.

Interfaces

ICalendarTriggerInterface that categorizes the trigger as a calendar trigger.
ITaskDefinitionEditor Represents a UI element that can edit task settings
ITaskEditor Represents a UI element that can edit tasks and their settings
ITaskEditorUIElement Represents a UI element that can must be forced to refresh its state
ITaskHandler Defines the methods that are called by the Task Scheduler service to manage a COM handler.
ITaskHandlerStatus Provides the methods that are used by COM handlers to notify the Task Scheduler about the status of the handler.
ITriggerDelayInterface for triggers that support a delay.
ITriggerUserIdInterface for triggers that support a user identifier.

Delegates

TaskServiceComHandlerUpdateDelegate for methods that support update calls during COM handler execution.

Enumerations

AvailableActionsDefines the type of actions available to a user interface element.
AvailableTaskTabsFlags representing tabs that can be visible on a TaskPropertiesControl.
AvailableTriggersTrigger types that can be made available to UI elements.
ComObjectSelectionDialogSupportedServersCOM server types that can be displayed by a ComObjectSelectionDialog.
CorrelatedTaskEventStatus Status of correlated task events
CorrelatedTaskEventTriggerType Type of trigger that initiated the task execution.
CustomComboBoxSizeMode Sizing mode for the CustomComboBox drop-down area.
DaysOfTheWeekValues for days of the week (Monday, Tuesday, etc.)
FullDateTimePickerFieldConversionUtcCheckBehaviorBehavior of producing value when Utc check is checked
FullDateTimePickerTimeFormatDetermines the format of the FullDateTimePicker control.
MonthsOfTheYearValues for months of the year (January, February, etc.)
PowerShellActionPlatformOptionOptions for when to convert actions to PowerShell equivalents.
QuickTriggerType Quick simple trigger types for the AddTask(String, Trigger, Action, String, String, TaskLogonType, String) method.
StandardTaskEventId Changes to tasks and the engine that cause events.
TaskActionTypeDefines the type of actions a task can perform.
TaskCompatibilityDefines what versions of Task Scheduler or the AT command that the task is compatible with.
TaskCreationDefines how the Task Scheduler service creates, updates, or disables the task.
TaskInstancesPolicyDefines how the Task Scheduler handles existing instances of the task when it starts a new instance of the task.
TaskLogonTypeDefines what logon technique is required to run a task.
TaskPrincipalPrivilegeDefines which privileges must be required for a secured task.
TaskProcessTokenSidType Defines the types of process security identifier (SID) that can be used by tasks. These changes are used to specify the type of process SID in the IPrincipal2 interface.
TaskRights Specifies the access control rights that can be applied to Task Scheduler tasks.
TaskRunFlagsDefines how a task is run.
TaskRunLevelDefines LUA elevation flags that specify with what privilege level the task will be run.
TaskSchedulerWizardAvailableWizardActions Flags to indicate which actions are available in the TaskSchedulerWizard.
TaskSchedulerWizardAvailableWizardPages Flags to indicate which pages are visible in the TaskSchedulerWizard.
TaskSchedulerWizardAvailableWizardTriggers Flags to indicate which triggers are available in the TaskSchedulerWizard.
TaskSessionStateChangeType Defines what kind of Terminal Server session state change you can use to trigger a task to start. These changes are used to specify the type of state change in the SessionStateChangeTrigger.
TaskSetSecurityOptionsOptions for use when calling the SetSecurityDescriptorSddlForm methods.
TaskStateDefines the different states that a registered task can be in.
TaskTriggerTypeDefines the type of triggers that can be used by tasks.
WhichWeekValues for week of month (first, second, ..., last)