Microsoft.Win32.TaskScheduler Defines the type of actions a task can perform. The action type is defined when the action is created and cannot be changed later. See . This action performs a command-line operation. For example, the action can run a script, launch an executable, or, if the name of a document is provided, find its associated application and launch the application with the document. This action fires a handler. This action sends and e-mail. This action shows a message box. An interface that exposes the ability to convert an actions functionality to a PowerShell script. Abstract base class that provides the common properties that are inherited by all action objects. An action object is created by the method. List of unbound values when working with Actions not associated with a registered task. Occurs when a property value changes. Gets the type of the action. The type of the action. Gets or sets the identifier of the action. Creates the specified action. Type of the action to instantiate. of specified type. Creates a new object that is a copy of the current instance. A new object that is a copy of this instance. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A value that indicates the relative order of the objects being compared. Releases all resources used by this class. Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Returns the action Id. String representation of action. Returns a that represents this action. The culture. String representation of action. Creates a specialized class from a defined interface. Version 1.0 interface. Specialized action class Creates a specialized class from a defined interface. Version 2.0 Action interface. Specialized action class Copies the properties from another the current instance. The source . Represents an action that fires a handler. Only available on Task Scheduler 2.0. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later. This action is the most complex. It allows the task to execute and In-Proc COM server object that implements the ITaskHandler interface. There is a sample project that shows how to do this in the Downloads section. Creates an unbound instance of . Creates an unbound instance of . Identifier of the handler class. Addition data associated with the handler. Gets or sets the identifier of the handler class. Gets the name of the object referred to by . Gets or sets additional data that is associated with the handler. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets a string representation of the . String representation of this action. Copies the properties from another the current instance. The source . Gets the name for CLSID. The unique identifier. Represents an action that sends an e-mail. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.This action has been deprecated in Windows 8 and later. However, this library is able to mimic its functionality using PowerShell if the property is set to . To disable this conversion, set the value to . The EmailAction allows for an email to be sent when the task is triggered. Creates an unbound instance of . Creates an unbound instance of . Subject of the e-mail. E-mail address that you want to send the e-mail from. E-mail address or addresses that you want to send the e-mail to. Body of the e-mail that contains the e-mail message. Name of the server that you use to send e-mail from. Gets or sets an array of file paths to be sent as attachments with the e-mail. Each item must be a value containing a path to file. Gets or sets the e-mail address or addresses that you want to Bcc in the e-mail. Gets or sets the body of the e-mail that contains the e-mail message. Gets or sets the e-mail address or addresses that you want to Cc in the e-mail. Gets or sets the e-mail address that you want to send the e-mail from. Gets or sets the header information in the e-mail message to send. Gets or sets the priority of the e-mail message. A that contains the priority of this message. Gets or sets the e-mail address that you want to reply to. Gets or sets the name of the server that you use to send e-mail from. Gets or sets the subject of the e-mail. Gets or sets the e-mail address or addresses that you want to send the e-mail to. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets a string representation of the . String representation of this action. Copies the properties from another the current instance. The source . Represents an action that executes a command-line operation. All versions of the base library support the ExecAction. It only has three properties that allow it to run an executable with parameters. Creates a new instance of an that can be added to . Creates a new instance of an that can be added to . Path to an executable file. Arguments associated with the command-line operation. This value can be null. Directory that contains either the executable file or the files that are used by the executable file. This value can be null. Gets or sets the arguments associated with the command-line operation. Gets or sets the path to an executable file. Gets or sets the directory that contains either the executable file or the files that are used by the executable file. Determines whether the specified path is a valid filename and, optionally, if it exists. The path. if set to true check if file exists. if set to true throw exception on error. true if the specified path is a valid filename; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Validates the input as a valid filename and optionally checks for its existence. If valid, the property is set to the validated absolute file path. The file path to validate. if set to true check if the file exists. Gets a string representation of the . String representation of this action. Copies the properties from another the current instance. The source . Represents an action that shows a message box when a task is activated. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later.This action has been deprecated in Windows 8 and later. However, this library is able to mimic its functionality using PowerShell if the property is set to . To disable this conversion, set the value to . Display a message when the trigger fires using the ShowMessageAction. Creates a new unbound instance of . Creates a new unbound instance of . Message text that is displayed in the body of the message box. Title of the message box. Gets or sets the message text that is displayed in the body of the message box. Gets or sets the title of the message box. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets a string representation of the . String representation of this action. Copies the properties from another the current instance. The source . Options for when to convert actions to PowerShell equivalents. Never convert any actions to PowerShell. This will force exceptions to be thrown when unsupported actions our action quantities are found. Convert actions under Version 1 of the library (Windows XP or Windows Server 2003 and earlier). This option supports multiple actions of all types. If not specified, only a single is supported. Developer must ensure that PowerShell v2 or higher is installed on the target computer. Convert all and references to their PowerShell equivalents on systems on or after Windows 8 / Server 2012. Convert all actions regardless of version or operating system. Collection that contains the actions that are performed by the task. Occurs when a collection changes. Occurs when a property value changes. Gets or sets the identifier of the principal for the task. Gets or sets the systems under which unsupported actions will be converted to PowerShell instances. The PowerShell platform options. This property will affect how many actions are physically stored in the system and is tied to the version of Task Scheduler. If set to , then no actions will ever be converted to PowerShell. This will force exceptions to be thrown when unsupported actions our action quantities are found. If set to , then actions will be converted only under Version 1 of the library (Windows XP or Windows Server 2003 and earlier). This option supports multiple actions of all types. If not specified, only a single is supported. Developer must ensure that PowerShell v2 or higher is installed on the target computer. If set to (which is the default value), then and references will be converted to their PowerShell equivalents on systems on or after Windows 8 / Server 2012. If set to , then any actions not supported by the Task Scheduler version will be converted to PowerShell. Gets or sets an XML-formatted version of the collection. Gets the number of actions in the collection. Gets or sets a specified action from the collection. The . The id ( ) of the action to be retrieved. Specialized instance. Mismatching Id for action and lookup. Gets or sets a an action at the specified index. The zero-based index of the action to get or set. Adds an action to the task. A type derived from . A derived class. The bound that was added to the collection. Adds an to the task. Path to an executable file. Arguments associated with the command-line operation. This value can be null. Directory that contains either the executable file or the files that are used by the executable file. This value can be null. The bound that was added to the collection. Adds a new instance to the task. Type of task to be created Specialized instance. Adds a collection of actions to the end of the . The actions to be added to the end of the . The collection itself cannot be null and cannot contain null elements. is null. Clears all actions from the task. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Determines whether the specified action type is contained in this collection. Type of the action. true if the specified action type is contained in this collection; otherwise, false. Copies the elements of the to an array of , starting at a particular index. The array that is the destination of the elements copied from . The array must have zero-based indexing. The zero-based index in array at which copying begins. Copies the elements of the to an array, starting at a particular array index. The zero-based index in the source at which copying begins. The array that is the destination of the elements copied from . The array must have zero-based indexing. The zero-based index in array at which copying begins. The number of elements to copy. is null. is less than 0. The number of elements in the source is greater than the available space from to the end of the destination . Releases all resources used by this class. Searches for an that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire collection. The delegate that defines the conditions of the to search for. The first that matches the conditions defined by the specified predicate, if found; otherwise, null. Searches for an that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the collection that starts at the specified index and contains the specified number of elements. The zero-based starting index of the search. The number of elements in the collection to search. The delegate that defines the conditions of the element to search for. The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. Searches for an that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the collection. The delegate that defines the conditions of the element to search for. The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. Retrieves an enumeration of each of the actions. Returns an object that implements the interface and that can iterate through the objects within the . Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Determines the index of a specific item in the . The id ( ) of the action to be retrieved. The index of if found in the list; otherwise, -1. Inserts an action at the specified index. The zero-based index at which action should be inserted. The action to insert into the list. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . Removes the action at a specified index. Index of action to remove. Index out of range. Copies the elements of the to a new array. An array containing copies of the elements of the . Returns a that represents the actions in this collection. A that represents the actions in this collection. Called when a property has changed to notify any attached elements. Name of the property. Functions to provide localized strings for enumerated types and values. Gets a string representing the localized value of the provided enum. The enum value. A localized string, if available. Pair of name and value. Occurs when a property has changed. Initializes a new instance of the class. Gets or sets the name. The name. Gets or sets the value. The value. Clones this instance. A copy of an unbound . Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Returns a that represents this instance. A that represents this instance. Implements the operator implicit NameValuePair. The KeyValuePair. The result of the operator. Contains a collection of name-value pairs. Occurs when the collection has changed. Occurs when a property has changed. Copies current to another. The destination collection. Releases all resources used by this class. Gets the number of items in the collection. Gets a collection of the names. The names. Gets a collection of the values. The values. Gets the value of the item at the specified index. The index of the item being requested. The value of the name-value pair at the specified index. Gets the value of the item with the specified name. Name to get the value for. Value for the name, or null if not found. Adds an item to the . The object to add to the . Adds a name-value pair to the collection. The name associated with a value in a name-value pair. The value associated with a name in a name-value pair. Adds the elements of the specified collection to the end of . The collection of whose elements should be added to the end of . Clears the entire collection of name-value pairs. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Removes the name-value pair with the specified key from the collection. The name associated with a value in a name-value pair. true if item successfully removed; false otherwise. Removes a selected name-value pair from the collection. Index of the pair to remove. Gets the value associated with the specified name. The name whose value to get. When this method returns, the value associated with the specified name, if the name is found; otherwise, null. This parameter is passed uninitialized. true if the collection contains an element with the specified name; otherwise, false. Gets the collection enumerator for the name-value collection. An for the collection. Abstract class for throwing a method specific exception. Defines the minimum supported version for the action not allowed by this exception. Initializes a new instance of the class. The serialization information. The streaming context. Gets a message that describes the current exception. Gets the minimum supported TaskScheduler version required for this method or property. Gets the object data. The information. The context. Thrown when the calling method is not supported by Task Scheduler 1.0. Initializes a new instance of the class. The serialization information. The streaming context. Initializes a new instance of the class. The message. Thrown when the calling method is not supported by Task Scheduler 2.0. Initializes a new instance of the class. The serialization information. The streaming context. Thrown when the calling method is not supported by Task Scheduler versions prior to the one specified. Initializes a new instance of the class. The serialization information. The streaming context. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Call a COM object. Looks up a localized string similar to Start a program. Looks up a localized string similar to Send an e-mail. Looks up a localized string similar to Display a message. Looks up a localized string similar to {3} {0:P}. Looks up a localized string similar to every day. Looks up a localized string similar to {1} {0}. Looks up a localized string similar to .. Looks up a localized string similar to The date and time a trigger expires must be later than the time time it starts or is activated.. Looks up a localized string similar to {0} {1}. Looks up a localized string similar to -. Looks up a localized string similar to ,. Looks up a localized string similar to every month. Looks up a localized string similar to Multiple actions defined. Looks up a localized string similar to Multiple triggers defined. Looks up a localized string similar to {0}. Looks up a localized string similar to Author. Looks up a localized string similar to Disabled. Looks up a localized string similar to Queued. Looks up a localized string similar to Ready. Looks up a localized string similar to Running. Looks up a localized string similar to Unknown. Looks up a localized string similar to any user. Looks up a localized string similar to At system startup. Looks up a localized string similar to Custom Trigger. Looks up a localized string similar to At {0:t} every day. Looks up a localized string similar to At {0:t} every {1} days. Looks up a localized string similar to indefinitely. Looks up a localized string similar to for a duration of {0}. Looks up a localized string similar to for {0}. Looks up a localized string similar to Trigger expires at {0:G}.. Looks up a localized string similar to Custom event filter. Looks up a localized string similar to On event - Log: {0}. Looks up a localized string similar to , Source: {0}. Looks up a localized string similar to , EventID: {0}. Looks up a localized string similar to When computer is idle. Looks up a localized string similar to At log on of {0}. Looks up a localized string similar to At {0:t} on day {1} of {2}, starting {0:d}. Looks up a localized string similar to At {0:t} on {1} {2:f} each {3}, starting {0:d}. Looks up a localized string similar to When the task is created or modified. Looks up a localized string similar to After triggered, repeat every {0} {1}.. Looks up a localized string similar to Every {0} {1}.. Looks up a localized string similar to On local connection to {0}.. Looks up a localized string similar to On local disconnect from {0}.. Looks up a localized string similar to On remote connection to {0}.. Looks up a localized string similar to On remote disconnect from {0}.. Looks up a localized string similar to On workstation lock of {0}.. Looks up a localized string similar to On workstation unlock of {0}.. Looks up a localized string similar to user session of {0}. Looks up a localized string similar to At {0:t} on {0:d}. Looks up a localized string similar to At startup. Looks up a localized string similar to Custom Trigger. Looks up a localized string similar to Daily. Looks up a localized string similar to On an event. Looks up a localized string similar to On idle. Looks up a localized string similar to At log on. Looks up a localized string similar to Monthly. Looks up a localized string similar to Monthly. Looks up a localized string similar to At task creation/modification. Looks up a localized string similar to On state change. Looks up a localized string similar to One time. Looks up a localized string similar to Weekly. Looks up a localized string similar to At {0:t} every {1} of every week, starting {0:d}. Looks up a localized string similar to At {0:t} every {1} of every {2} weeks, starting {0:d}. Looks up a localized string similar to every. Looks up a localized string similar to fifth. Looks up a localized string similar to first. Looks up a localized string similar to fourth. Looks up a localized string similar to last. Looks up a localized string similar to second. Looks up a localized string similar to third. Some string values of properties can be set to retrieve their value from existing DLLs as a resource. This class facilitates creating those reference strings. Initializes a new instance of the class. The DLL path. The resource identifier. Gets or sets the resource file path. This can be a relative path, full path or lookup path (e.g. %SystemRoot%\System32\ResourceName.dll). The resource file path. Gets or sets the resource identifier. The resource identifier. Performs an implicit conversion from to . The value. The result of the conversion. Parses the input string. String must be in the format "$(@ [Dll], [ResourceID])". The input string value. A new instance on success or null on failure. is null is not in the format "$(@ [Dll], [ResourceID])" Tries to parse to input string. String must be in the format "$(@ [Dll], [ResourceID])". The input string value. The resource reference to be returned. On failure, this value equals null. A new instance on success or null on failure. Gets the result of pulling the string from the resource file using the identifier. from resource file. cannot be found. Unable to load or string identified by . Returns a in the format required by the Task Scheduler to reference a string in a DLL. A formatted in the format $(@ [Dll], [ResourceID]). Abstract class representing a secured item for storage in a . Initializes a new instance of the class. The path to the item. The SDDL for the item. Gets the path to the item. The path to the item. Gets the SDDL for the item. The SDDL for the item. Represents a instance and captures its name and security. Initializes a new instance of the class. The path to the item. The SDDL for the item. Represents all the information about the tasks and folders from a instance that can be used to reconstitute tasks and folders on the same or different systems. 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. Creates a new instance of from an existing snapshot. The zip file snapshot created by the method. Gets a list of and instances the represent the tasks and folders from a Task Scheduler instance. Gets the path of the file based snapshot. Gets the machine name of the server from which the snapshot was taken. The target server name. Gets the UTC time stamp for when the snapshot was taken. The time stamp. Creates a compressed zip file that contains all the information accessible to the user from the instance necessary to reconstitute its tasks and folders. This method can take many seconds to execute. It is recommended to call the asynchronous version.This method will execute without error even if the user does not have permissions to see all tasks and folders. It is imperative that the developer ensures that the user has Administrator or equivalent rights before calling this method. The from which to pull the tasks and folders. The output zip file in which to place the snapshot information. A instance with the contents of the specified Task Scheduler connection. Creates a compressed zip file that contains all the information accessible to the user from the instance necessary to reconstitute its tasks and folders. This method will execute without error even if the user does not have permissions to see all tasks and folders. It is imperative that the developer ensures that the user has Administrator or equivalent rights before calling this method. The from which to pull the tasks and folders. The output zip file in which to place the snapshot information. A cancellation token to use to cancel this asynchronous operation. An optional instance to use to report progress of the asynchronous operation. An asynchronous instance with the contents of the specified Task Scheduler connection. Opens an existing snapshot and returns a new instance of . The zip file snapshot created by the method. A instance with the contents of the specified snapshot file. Register a list of snapshot items (tasks and folders) into the specified Task Scheduler. The into which the tasks and folders are registered. The list of paths representing the tasks and folders from this snapshot that should be registered on the instance. If true, takes the access rights from the snapshot item and applies it to both new and existing tasks and folders. If true, overwrite any existing tasks and folders found in the target Task Scheduler that match the path of the snapshot item. Lookup table for password. Provide pairs of the user/group account name and the associated passwords for any task that requires a password. A cancellation token to use to cancel this asynchronous operation. An optional instance to use to report progress of the asynchronous operation. An asynchronous instance. Register a list of snapshot items (tasks and folders) into the specified Task Scheduler. The into which the tasks and folders are registered. The list of instances representing the tasks and folders from this snapshot that should be registered on the instance. If true, takes the access rights from the snapshot item and applies it to both new and existing tasks and folders. If true, overwrite any existing tasks and folders found in the target Task Scheduler that match the path of the snapshot item. Lookup table for password. Provide pairs of the user/group account name and the associated passwords for any task that requires a password. A cancellation token to use to cancel this asynchronous operation. An optional instance to use to report progress of the asynchronous operation. An asynchronous instance. Register a list of snapshot items (tasks and folders) into the specified Task Scheduler. The into which the tasks and folders are registered. The list of instances representing the tasks and folders from this snapshot that should be registered on the instance. If true, takes the access rights from the snapshot item and applies it to both new and existing tasks and folders. If true, overwrite any existing tasks and folders found in the target Task Scheduler that match the path of the snapshot item. Lookup table for password. Provide pairs of the user/group account name and the associated passwords for any task that requires a password. Represents a instance and captures its details. Initializes a new instance of the class. The path to the item. The SDDL for the item. If set to true task is enabled. The XML for the . Gets a value indicating whether th is enabled. true if enabled; otherwise, false. Gets the XML. The XML. Defines what versions of Task Scheduler or the AT command that the task is compatible with. The task is compatible with the AT command. The task is compatible with Task Scheduler 1.0 (Windows Server™ 2003, Windows® XP, or Windows® 2000). Items not available when compared to V2: TaskDefinition.Principal.GroupId - All account information can be retrieved via the UserId property. TaskLogonType values Group, None and S4U are not supported. TaskDefinition.Principal.RunLevel == TaskRunLevel.Highest is not supported. Assigning access security to a task is not supported using TaskDefinition.RegistrationInfo.SecurityDescriptorSddlForm or in RegisterTaskDefinition. TaskDefinition.RegistrationInfo.Documentation, Source, URI and Version properties are only supported using this library. See details in the remarks for . TaskDefinition.Settings.AllowDemandStart cannot be false. TaskDefinition.Settings.AllowHardTerminate cannot be false. TaskDefinition.Settings.MultipleInstances can only be IgnoreNew. TaskDefinition.Settings.NetworkSettings cannot have any values. TaskDefinition.Settings.RestartCount can only be 0. TaskDefinition.Settings.StartWhenAvailable can only be false. TaskDefinition.Actions can only contain ExecAction instances unless the TaskDefinition.Actions.PowerShellConversion property has the Version1 flag set. TaskDefinition.Triggers cannot contain CustomTrigger, EventTrigger, SessionStateChangeTrigger, or RegistrationTrigger instances. TaskDefinition.Triggers cannot contain instances with delays set. TaskDefinition.Triggers cannot contain instances with ExecutionTimeLimit or Id properties set. TaskDefinition.Triggers cannot contain LogonTriggers instances with the UserId property set. TaskDefinition.Triggers cannot contain MonthlyDOWTrigger instances with the RunOnLastWeekOfMonth property set to true. TaskDefinition.Triggers cannot contain MonthlyTrigger instances with the RunOnDayWeekOfMonth property set to true. The task is compatible with Task Scheduler 2.0 (Windows Vista™, Windows Server™ 2008). This version is the baseline for the new, non-file based Task Scheduler. See remarks for functionality that was not forward-compatible. The task is compatible with Task Scheduler 2.1 (Windows® 7, Windows Server™ 2008 R2). Changes from V2: TaskDefinition.Principal.ProcessTokenSidType can be defined as a value other than Default. TaskDefinition.Actions may not contain EmailAction or ShowMessageAction instances unless the TaskDefinition.Actions.PowerShellConversion property has the Version2 flag set. TaskDefinition.Principal.RequiredPrivileges can have privilege values assigned. TaskDefinition.Settings.DisallowStartOnRemoteAppSession can be set to true. TaskDefinition.UseUnifiedSchedulingEngine can be set to true. The task is compatible with Task Scheduler 2.2 (Windows® 8.x, Windows Server™ 2012). Changes from V2_1: TaskDefinition.Settings.MaintenanceSettings can have Period or Deadline be values other than TimeSpan.Zero or the Exclusive property set to true. TaskDefinition.Settings.Volatile can be set to true. The task is compatible with Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016). Changes from V2_2: None published. Defines how the Task Scheduler service creates, updates, or disables the task. The Task Scheduler service registers the task as a new task. The Task Scheduler service either registers the task as a new task or as an updated version if the task already exists. Equivalent to Create | Update. The Task Scheduler service registers the disabled task. A disabled task cannot run until it is enabled. For more information, see Enabled Property of TaskSettings and Enabled Property of RegisteredTask. The Task Scheduler service is prevented from adding the allow access-control entry (ACE) for the context principal. When the TaskFolder.RegisterTaskDefinition or TaskFolder.RegisterTask functions are called with this flag to update a task, the Task Scheduler service does not add the ACE for the new context principal and does not remove the ACE from the old context principal. The Task Scheduler service creates the task, but ignores the registration triggers in the task. By ignoring the registration triggers, the task will not execute when it is registered unless a time-based trigger causes it to execute on registration. The Task Scheduler service registers the task as an updated version of an existing task. When a task with a registration trigger is updated, the task will execute after the update occurs. The Task Scheduler service checks the syntax of the XML that describes the task but does not register the task. This constant cannot be combined with the Create, Update, or CreateOrUpdate values. Defines how the Task Scheduler handles existing instances of the task when it starts a new instance of the task. Starts new instance while an existing instance is running. Starts a new instance of the task after all other instances of the task are complete. Does not start a new instance if an existing instance of the task is running. Stops an existing instance of the task before it starts a new instance. Defines what logon technique is required to run a task. The logon method is not specified. Used for non-NT credentials. Use a password for logging on the user. The password must be supplied at registration time. Use an existing interactive token to run a task. The user must log on using a service for user (S4U) logon. When an S4U logon is used, no password is stored by the system and there is no access to either the network or to encrypted files. User must already be logged on. The task will be run only in an existing interactive session. Group activation. The groupId field specifies the group. Indicates that a Local System, Local Service, or Network Service account is being used as a security context to run the task. First use the interactive token. If the user is not logged on (no interactive token is available), then the password is used. The password must be specified when a task is registered. This flag is not recommended for new tasks because it is less reliable than Password. Defines which privileges must be required for a secured task. Required to create a primary token. User Right: Create a token object. Required to assign the primary token of a process. User Right: Replace a process-level token. Required to lock physical pages in memory. User Right: Lock pages in memory. Required to increase the quota assigned to a process. User Right: Adjust memory quotas for a process. Required to read unsolicited input from a terminal device. User Right: Not applicable. Required to create a computer account. User Right: Add workstations to domain. This privilege identifies its holder as part of the trusted computer base. Some trusted protected subsystems are granted this privilege. User Right: Act as part of the operating system. Required to perform a number of security-related functions, such as controlling and viewing audit messages. This privilege identifies its holder as a security operator. User Right: Manage auditing and the security log. Required to take ownership of an object without being granted discretionary access. This privilege allows the owner value to be set only to those values that the holder may legitimately assign as the owner of an object. User Right: Take ownership of files or other objects. Required to load or unload a device driver. User Right: Load and unload device drivers. Required to gather profiling information for the entire system. User Right: Profile system performance. Required to modify the system time. User Right: Change the system time. Required to gather profiling information for a single process. User Right: Profile single process. Required to increase the base priority of a process. User Right: Increase scheduling priority. Required to create a paging file. User Right: Create a pagefile. Required to create a permanent object. User Right: Create permanent shared objects. Required to perform backup operations. This privilege causes the system to grant all read access control to any file, regardless of the access control list (ACL) specified for the file. Any access request other than read is still evaluated with the ACL. This privilege is required by the RegSaveKey and RegSaveKeyExfunctions. The following access rights are granted if this privilege is held: READ_CONTROL, ACCESS_SYSTEM_SECURITY, FILE_GENERIC_READ, FILE_TRAVERSE. User Right: Back up files and directories. Required to perform restore operations. This privilege causes the system to grant all write access control to any file, regardless of the ACL specified for the file. Any access request other than write is still evaluated with the ACL. Additionally, this privilege enables you to set any valid user or group security identifier (SID) as the owner of a file. This privilege is required by the RegLoadKey function. The following access rights are granted if this privilege is held: WRITE_DAC, WRITE_OWNER, ACCESS_SYSTEM_SECURITY, FILE_GENERIC_WRITE, FILE_ADD_FILE, FILE_ADD_SUBDIRECTORY, DELETE. User Right: Restore files and directories. Required to shut down a local system. User Right: Shut down the system. Required to debug and adjust the memory of a process owned by another account. User Right: Debug programs. Required to generate audit-log entries. Give this privilege to secure servers. User Right: Generate security audits. Required to modify the nonvolatile RAM of systems that use this type of memory to store configuration information. User Right: Modify firmware environment values. Required to receive notifications of changes to files or directories. This privilege also causes the system to skip all traversal access checks. It is enabled by default for all users. User Right: Bypass traverse checking. Required to shut down a system by using a network request. User Right: Force shutdown from a remote system. Required to undock a laptop. User Right: Remove computer from docking station. Required for a domain controller to use the LDAP directory synchronization services. This privilege allows the holder to read all objects and properties in the directory, regardless of the protection on the objects and properties. By default, it is assigned to the Administrator and LocalSystem accounts on domain controllers. User Right: Synchronize directory service data. Required to mark user and computer accounts as trusted for delegation. User Right: Enable computer and user accounts to be trusted for delegation. Required to enable volume management privileges. User Right: Manage the files on a volume. Required to impersonate. User Right: Impersonate a client after authentication. Windows XP/2000: This privilege is not supported. Note that this value is supported starting with Windows Server 2003, Windows XP with SP2, and Windows 2000 with SP4. Required to create named file mapping objects in the global namespace during Terminal Services sessions. This privilege is enabled by default for administrators, services, and the local system account. User Right: Create global objects. Windows XP/2000: This privilege is not supported. Note that this value is supported starting with Windows Server 2003, Windows XP with SP2, and Windows 2000 with SP4. Required to access Credential Manager as a trusted caller. User Right: Access Credential Manager as a trusted caller. Required to modify the mandatory integrity level of an object. User Right: Modify an object label. Required to allocate more memory for applications that run in the context of users. User Right: Increase a process working set. Required to adjust the time zone associated with the computer's internal clock. User Right: Change the time zone. Required to create a symbolic link. User Right: Create symbolic links. 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. No changes will be made to the process token groups list. A task SID that is derived from the task name will be added to the process token groups list, and the token default discretionary access control list (DACL) will be modified to allow only the task SID and local system full control and the account SID read control. A Task Scheduler will apply default settings to the task process. Defines how a task is run. The task is run with all flags ignored. The task is run as the user who is calling the Run method. The task is run regardless of constraints such as "do not run on batteries" or "run only if idle". The task is run using a terminal server session identifier. The task is run using a security identifier. Defines LUA elevation flags that specify with what privilege level the task will be run. Tasks will be run with the least privileges. Tasks will be run with the highest privileges. 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. Terminal Server console connection state change. For example, when you connect to a user session on the local computer by switching users on the computer. Terminal Server console disconnection state change. For example, when you disconnect to a user session on the local computer by switching users on the computer. Terminal Server remote connection state change. For example, when a user connects to a user session by using the Remote Desktop Connection program from a remote computer. Terminal Server remote disconnection state change. For example, when a user disconnects from a user session while using the Remote Desktop Connection program from a remote computer. Terminal Server session locked state change. For example, this state change causes the task to run when the computer is locked. Terminal Server session unlocked state change. For example, this state change causes the task to run when the computer is unlocked. Options for use when calling the SetSecurityDescriptorSddlForm methods. No special handling. The Task Scheduler service is prevented from adding the allow access-control entry (ACE) for the context principal. Defines the different states that a registered task can be in. The state of the task is unknown. The task is registered but is disabled and no instances of the task are queued or running. The task cannot be run until it is enabled. Instances of the task are queued. The task is ready to be executed, but no instances are queued or running. One or more instances of the task is running. Specifies how the Task Scheduler performs tasks when the computer is in an idle condition. For information about idle conditions, see Task Idle Conditions. Occurs when a property value changes. Gets or sets a value that indicates the amount of time that the computer must be in an idle state before the task is run. A value that indicates the amount of time that the computer must be in an idle state before the task is run. The minimum value is one minute. If this value is TimeSpan.Zero, then the delay will be set to the default of 10 minutes. Gets or sets a Boolean value that indicates whether the task is restarted when the computer cycles into an idle condition more than once. Gets or sets a Boolean value that indicates that the Task Scheduler will terminate the task if the idle condition ends before the task is completed. Gets or sets a value that indicates the amount of time that the Task Scheduler will wait for an idle condition to occur. If no value is specified for this property, then the Task Scheduler service will wait indefinitely for an idle condition to occur. A value that indicates the amount of time that the Task Scheduler will wait for an idle condition to occur. The minimum time allowed is 1 minute. If this value is TimeSpan.Zero, then the delay will be set to the default of 1 hour. Releases all resources used by this class. Returns a that represents this instance. A that represents this instance. Called when a property has changed to notify any attached elements. Name of the property. Specifies the task settings the Task scheduler will use to start task during Automatic maintenance. Occurs when a property value changes. Gets or sets the amount of time after which the Task scheduler attempts to run the task during emergency Automatic maintenance, if the task failed to complete during regular Automatic maintenance. The minimum value is one day. The value of the property should be greater than the value of the property. If the deadline is not specified the task will not be started during emergency Automatic maintenance. Property set for a task on a Task Scheduler version prior to 2.2. Gets or sets a value indicating whether the Task Scheduler must start the task during the Automatic maintenance in exclusive mode. The exclusivity is guaranteed only between other maintenance tasks and doesn't grant any ordering priority of the task. If exclusivity is not specified, the task is started in parallel with other maintenance tasks. Property set for a task on a Task Scheduler version prior to 2.2. Gets or sets the amount of time the task needs to be started during Automatic maintenance. The minimum value is one minute. Property set for a task on a Task Scheduler version prior to 2.2. Releases all resources used by this class. Returns a that represents this instance. A that represents this instance. Called when a property has changed to notify any attached elements. Name of the property. Provides the settings that the Task Scheduler service uses to obtain a network profile. Occurs when a property value changes. Gets or sets a GUID value that identifies a network profile. Not supported under Task Scheduler 1.0. Gets or sets the name of a network profile. The name is used for display purposes. Not supported under Task Scheduler 1.0. Releases all resources used by this class. Returns a that represents this instance. A that represents this instance. Called when a property has changed to notify any attached elements. Name of the property. Provides the methods to get information from and control a running task. Gets the process ID for the engine (process) which is running the task. Not supported under Task Scheduler 1.0. Gets the name of the current action that the running task is performing. Gets the GUID identifier for this instance of the task. Gets the operational state of the running task. Releases all resources used by this class. Refreshes all of the local instance variables of the task. Thrown if task is no longer running. 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. Occurs when a property value changes. Gets the definition of the task. Gets or sets a Boolean value that indicates if the registered task is enabled. As of version 1.8.1, under V1 systems (prior to Vista), this property will immediately update the Disabled state and re-save the current task. If changes have been made to the , then those changes will be saved. Gets an instance of the parent folder. A object representing the parent folder of this task. Gets a value indicating whether this task instance is active. true if this task instance is active; otherwise, false. Gets the time the registered task was last run. Returns if there are no prior run times. Gets the results that were returned the last time the registered task was run. The value returned is the last exit code of the last program run via an . Gets the time when the registered task is next scheduled to run. Returns if there are no future run times. Potentially breaking change in release 1.8.2. For Task Scheduler 2.0, the return value prior to 1.8.2 would be Dec 30, 1899 if there were no future run times. For 1.0, that value would have been DateTime.MinValue. In release 1.8.2 and later, all versions will return DateTime.MinValue if there are no future run times. While this is different from the native 2.0 library, it was deemed more appropriate to have consistency between the two libraries and with other .NET libraries. Gets a value indicating whether this task is read only. Only available if is true. true if read only; otherwise, false. Gets or sets the security descriptor for the task. The security descriptor. Gets the operational state of the registered task. Gets or sets the that manages this task. The task service. Gets the name of the registered task. Gets the number of times the registered task has missed a scheduled run. Not supported under Task Scheduler 1.0. Gets the path to where the registered task is stored. Gets the XML-formatted registration information for the registered task. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A value that indicates the relative order of the objects being compared. Releases all resources used by this class. Exports the task to the specified file in XML. Name of the output file. Gets a object that encapsulates the specified type of access control list (ACL) entries for the task described by the current object. A object that encapsulates the access control rules for the current task. Gets a object that encapsulates the specified type of access control list (ACL) entries for the task described by the current object. One of the values that specifies which group of access control entries to retrieve. A object that encapsulates the access control rules for the current task. Gets all instances of the currently running registered task. A with all instances of current task. Not supported under Task Scheduler 1.0. Gets the last registration time, looking first at the value and then looking for the most recent registration event in the Event Log. of the last registration or if no value can be found. Gets the times that the registered task is scheduled to run during a specified time. The starting time for the query. The ending time for the query. The requested number of runs. A value of 0 will return all times requested. The scheduled times that the task will run. Gets the security descriptor for the task. Not available to Task Scheduler 1.0. Section(s) of the security descriptor to return. The security descriptor for the task. Not supported under Task Scheduler 1.0. Updates the task with any changes made to the by calling from the currently registered folder using the currently registered name. Thrown if task was previously registered with a password. Runs the registered task immediately. The parameters used as values in the task actions. A maximum of 32 parameters can be supplied. To run a task with no parameters, call this method without any values (e.g. Run() ). The string values that you specify are paired with names and stored as name-value pairs. If you specify a single string value, then Arg0 will be the name assigned to the value. The value can be used in the task action where the $(Arg0) variable is used in the action properties. If you pass in values such as "0", "100", and "250" as an array of string values, then "0" will replace the $(Arg0) variables, "100" will replace the $(Arg1) variables, and "250" will replace the $(Arg2) variables used in the action properties. For more information and a list of action properties that can use $(Arg0), $(Arg1), ..., $(Arg32) variables in their values, see Task Actions. A instance that defines the new instance of the task. Runs the registered task immediately using specified flags and a session identifier. Defines how the task is run. The terminal server session in which you want to start the task. If the value is not passed into the parameter, then the value specified in this parameter is ignored.If the value is passed into the flags parameter and the sessionID value is less than or equal to 0, then an invalid argument error will be returned. If the value is passed into the parameter and the sessionID value is a valid session ID greater than 0 and if no value is specified for the user parameter, then the Task Scheduler service will try to start the task interactively as the user who is logged on to the specified session. If the value is passed into the parameter and the sessionID value is a valid session ID greater than 0 and if a user is specified in the user parameter, then the Task Scheduler service will try to start the task interactively as the user who is specified in the user parameter. The user for which the task runs. The parameters used as values in the task actions. A maximum of 32 parameters can be supplied. To run a task with no parameters, call this method without any values (e.g. RunEx(0, 0, "MyUserName") ). The string values that you specify are paired with names and stored as name-value pairs. If you specify a single string value, then Arg0 will be the name assigned to the value. The value can be used in the task action where the $(Arg0) variable is used in the action properties. If you pass in values such as "0", "100", and "250" as an array of string values, then "0" will replace the $(Arg0) variables, "100" will replace the $(Arg1) variables, and "250" will replace the $(Arg2) variables used in the action properties. For more information and a list of action properties that can use $(Arg0), $(Arg1), ..., $(Arg32) variables in their values, see Task Actions. A instance that defines the new instance of the task. This method will return without error, but the task will not run if the AllowDemandStart property of ITaskSettings is set to false for the task. If RunEx is invoked from a disabled task, it will return null and the task will not be run. Not supported under Task Scheduler 1.0. Applies access control list (ACL) entries described by a object to the file described by the current object. A object that describes an access control list (ACL) entry to apply to the current task. Give read access to all authenticated users for a task. Sets the security descriptor for the task. Not available to Task Scheduler 1.0. The security descriptor for the task. Flags that specify how to set the security descriptor. Not supported under Task Scheduler 1.0. Dynamically tries to load the assembly for the editor and displays it as editable for this task. true if editor returns with OK response; false otherwise. The Microsoft.Win32.TaskSchedulerEditor.dll assembly must reside in the same directory as the Microsoft.Win32.TaskScheduler.dll or in the GAC. Shows the property page for the task (v1.0 only). Stops the registered task immediately. The Stop method stops all instances of the task. System account users can stop a task, users with Administrator group privileges can stop a task, and if a user has rights to execute and read a task, then the user can stop the task. A user can stop the task instances that are running under the same credentials as the user account. In all other cases, the user is denied access to stop the task. Returns a that represents this instance. A that represents this instance. Gets the ITaskDefinition for a V2 task and prevents the errors that come when connecting remotely to a higher version of the Task Scheduler. The local task service. The task instance. if set to true this method will throw an exception if unable to get the task definition. A valid ITaskDefinition that should not throw errors on the local instance. Unable to get a compatible task definition for this version of the library. Called when a property has changed to notify any attached elements. Name of the property. Contains information about the compatibility of the current configuration with a specified version. Gets the compatibility level. The compatibility level. Gets the property name with the incompatibility. The property name. Gets the reason for the incompatibility. The reason. Defines all the components of a task, such as the task settings, triggers, actions, and registration information. Occurs when a property value changes. Gets a collection of actions that are performed by the task. Gets or sets the data that is associated with the task. This data is ignored by the Task Scheduler service, but is used by third-parties who wish to extend the task format. For V1 tasks, this library makes special use of the SetWorkItemData and GetWorkItemData methods and does not expose that data stream directly. Instead, it uses that data stream to hold a dictionary of properties that are not supported under V1, but can have values under V2. An example of this is the value which is stored in the data stream. The library does not provide direct access to the V1 work item data. If using V2 properties with a V1 task, programmatic access to the task using the native API will retrieve unreadable results from GetWorkItemData and will eliminate those property values if SetWorkItemData is used. Gets the lowest supported version that supports the settings for this . Gets a collection of triggers that are used to start a task. Gets or sets the XML-formatted definition of the task. Gets the principal for the task that provides the security credentials for the task. Gets a class instance of registration information that is used to describe a task, such as the description of the task, the author of the task, and the date the task is registered. Gets the settings that define how the Task Scheduler service performs the task. Gets the XML Schema file for V1 tasks. The for V1 tasks. An object containing the XML Schema for V1 tasks. Determines whether this can use the Unified Scheduling Engine or if it contains unsupported properties. if set to true throws an with details about unsupported properties in the Data property of the exception. true if this can use the Unified Scheduling Engine; otherwise, false. Releases all resources used by this class. Validates the current . if set to true throw a with details about invalid properties. true if current is valid; false if not. Gets the lowest supported version. The output list. Called when a property has changed to notify any attached elements. Name of the property. Provides the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal. Occurs when a property value changes. Gets the account associated with this principal. This value is pulled from the TaskDefinition's XMLText property if set. The account. Gets or sets the name of the principal that is displayed in the Task Scheduler UI. Not supported under Task Scheduler 1.0. Gets or sets the identifier of the user group that is required to run the tasks that are associated with the principal. Setting this property to something other than a null or empty string, will set the property to NULL and will set the property to TaskLogonType.Group; Not supported under Task Scheduler 1.0. Gets or sets the identifier of the principal. Not supported under Task Scheduler 1.0. Gets or sets the security logon method that is required to run the tasks that are associated with the principal. TaskLogonType values of Group, None, or S4UNot are not supported under Task Scheduler 1.0. Gets or sets the task process security identifier (SID) type. One of the enumeration constants. Setting this value appears to break the Task Scheduler MMC and does not output in XML. Removed to prevent problems. Not supported under Task Scheduler versions prior to 2.1. Gets the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal. Setting this value appears to break the Task Scheduler MMC and does not output in XML. Removed to prevent problems. Gets or sets the identifier that is used to specify the privilege level that is required to run the tasks that are associated with the principal. Not supported under Task Scheduler 1.0. Gets or sets the user identifier that is required to run the tasks that are associated with the principal. Setting this property to something other than a null or empty string, will set the property to NULL; Validates the supplied account against the supplied . The user or group account name. The SID type for the process. true if supplied account can be used for the supplied SID type. Releases all resources used by this class. Gets a value indicating whether current Principal settings require a password to be provided. true if settings requires a password to be provided; otherwise, false. Returns a that represents this instance. A that represents this instance. Called when a property has changed to notify any attached elements. Name of the property. 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. Gets the number of elements contained in the . The number of elements contained in the . Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Gets or sets the element at the specified index. The element at the specified index. is not a valid index in the . The property is set and the is read-only. Adds an item to the . The object to add to the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Removes all items from the . The is read-only. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Enumerates the privileges set for a principal under version 1.3 of the Task Scheduler. Gets the element in the collection at the current position of the enumerator. The element in the collection at the current position of the enumerator. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Advances the enumerator to the next element of the collection. true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. The collection was modified after the enumerator was created. Sets the enumerator to its initial position, which is before the first element in the collection. The collection was modified after the enumerator was created. 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. Occurs when a property value changes. Gets or sets the author of the task. Gets or sets the date and time when the task is registered. Gets or sets the description of the task. Gets or sets any additional documentation for the task. Gets or sets the security descriptor of the task. The security descriptor. Gets or sets the security descriptor of the task. Not supported under Task Scheduler 1.0. Gets or sets where the task originated from. For example, a task may originate from a component, service, application, or user. Gets or sets the URI of the task. Note: Breaking change in version 2.0. This property was previously of type . It was found that in Windows 8, many of the native tasks use this property in a string format rather than in a URI format. Gets or sets the version number of the task. Gets or sets an XML-formatted version of the registration information for the task. Releases all resources used by this class. Returns a that represents this instance. A that represents this instance. Called when a property has changed to notify any attached elements. Name of the property. Provides the settings that the Task Scheduler service uses to perform the task. Occurs when a property value changes. Gets or sets a Boolean value that indicates that the task can be started by using either the Run command or the Context menu. Not supported under Task Scheduler 1.0. Gets or sets a Boolean value that indicates that the task may be terminated by using TerminateProcess. Not supported under Task Scheduler 1.0. Gets or sets an integer value that indicates which version of Task Scheduler a task is compatible with. Not supported under Task Scheduler 1.0. Gets or sets the amount of time that the Task Scheduler will wait before deleting the task after it expires. If no value is specified for this property, then the Task Scheduler service will not delete the task. Gets and sets the amount of time that the Task Scheduler will wait before deleting the task after it expires. A TimeSpan value of 1 second indicates the task is set to delete when done. A value of TimeSpan.Zero indicates that the task should not be deleted. A task expires after the end boundary has been exceeded for all triggers associated with the task. The end boundary for a trigger is specified by the EndBoundary property of all trigger types. Gets or sets a Boolean value that indicates that the task will not be started if the computer is running on battery power. Gets or sets a Boolean value that indicates that the task will not be started if the task is triggered to run in a Remote Applications Integrated Locally (RAIL) session. Property set for a task on a Task Scheduler version prior to 2.1. Gets or sets a Boolean value that indicates that the task is enabled. The task can be performed only when this setting is TRUE. Gets or sets the amount of time that is allowed to complete the task. By default, a task will be stopped 72 hours after it starts to run. The amount of time that is allowed to complete the task. When this parameter is set to , the execution time limit is infinite. If a task is started on demand, the ExecutionTimeLimit setting is bypassed. Therefore, a task that is started on demand will not be terminated if it exceeds the ExecutionTimeLimit. Gets or sets a Boolean value that indicates that the task will not be visible in the UI by default. Gets or sets the information that the Task Scheduler uses during Automatic maintenance. Gets or sets the policy that defines how the Task Scheduler handles multiple instances of the task. Not supported under Task Scheduler 1.0. Gets or sets the priority level of the task. The priority. Value set to AboveNormal or BelowNormal on Task Scheduler 1.0. Gets or sets the number of times that the Task Scheduler will attempt to restart the task. The number of times that the Task Scheduler will attempt to restart the task. If this property is set, the property must also be set. Not supported under Task Scheduler 1.0. Gets or sets a value that specifies how long the Task Scheduler will attempt to restart the task. A value that specifies how long the Task Scheduler will attempt to restart the task. If this property is set, the property must also be set. The maximum time allowed is 31 days, and the minimum time allowed is 1 minute. Not supported under Task Scheduler 1.0. Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only if the computer is in an idle condition. Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only if the user is logged on (v1.0 only) Property set for a task on a Task Scheduler version other than 1.0. Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only when a network is available. Gets or sets a Boolean value that indicates that the Task Scheduler can start the task at any time after its scheduled time has passed. Not supported under Task Scheduler 1.0. Gets or sets a Boolean value that indicates that the task will be stopped if the computer switches to battery power. Gets or sets a Boolean value that indicates that the Unified Scheduling Engine will be utilized to run this task. Property set for a task on a Task Scheduler version prior to 2.1. Gets or sets a boolean value that indicates whether the task is automatically disabled every time Windows starts. Property set for a task on a Task Scheduler version prior to 2.2. Gets or sets a Boolean value that indicates that the Task Scheduler will wake the computer when it is time to run the task. Gets or sets an XML-formatted definition of the task settings. Gets or sets the information that specifies how the Task Scheduler performs tasks when the computer is in an idle state. Gets or sets the network settings object that contains a network profile identifier and name. If the RunOnlyIfNetworkAvailable property of ITaskSettings is true and a network profile is specified in the NetworkSettings property, then the task will run only if the specified network profile is available. Releases all resources used by this class. Returns a that represents this instance. A that represents this instance. Called when a property has changed to notify any attached elements. Name of the property. Collection of running tasks in a . This class has no public constructor and can only be accessed via the properties and functions within . Gets the number of registered tasks in the collection. Gets the specified running task from the collection. The index of the running task to be retrieved. A instance. Releases all resources used by this class. Gets an IEnumerator instance for this collection. An enumerator. Returns a that represents this instance. A that represents this instance. Releases all resources used by this class. Contains all the tasks that are registered within a . This class has no public constructor and can only be accessed via the properties and functions within . Potentially breaking change in 1.6.2 and later where under V1 the list previously included the '.job' extension on the task name. This has been removed so that it is consistent with V2. public class Program { bool RootFolderHasTask(string taskName) { if (TaskService.Instance.RootFolder.Tasks.Count > 0) { return TaskService.Instance.RootFolder.Tasks.Exists(taskName); } return false; } TaskCollection GetRootTasksStartingWith(string value) { var pattern = $"^{Regex.Escape(value)}.*$"; return TaskService.Instance.RootFolder.GetTasks(new Regex(pattern)); } public static void Main() { foreach (var task in GetRootTasksStartingWith("MyCo")) if (RootFolderHasTask(task.Name)) Console.WriteLine(task.Name); } } Gets the number of registered tasks in the collection. Gets or sets the regular expression filter for task names. The regular expression filter. Gets the specified registered task from the collection. The index of the registered task to be retrieved. A instance that contains the requested context. Gets the named registered task from the collection. The name of the registered task to be retrieved. A instance that contains the requested context. Releases all resources used by this class. Determines whether the specified task exists. The name of the task. true if task exists; otherwise, false. Gets the collection enumerator for the register task collection. An for this collection. Returns a that represents this instance. A that represents this instance. Internal constructor TaskService instance The filter. Retrieves the current task. See for more information. Releases all resources used by this class. Moves to the next task. See MoveNext for more information. true if next task found, false if no more tasks. Reset task enumeration. See Reset for more information. Changes to tasks and the engine that cause events. Task Scheduler started an instance of a task for a user. For detailed information, see the documentation for Event ID 100 on TechNet. Task Scheduler failed to start a task for a user. For detailed information, see the documentation for Event ID 101 on TechNet. Task Scheduler successfully finished an instance of a task for a user. For detailed information, see the documentation for Event ID 102 on TechNet. Task Scheduler failed to start an instance of a task for a user. For detailed information, see the documentation for Event ID 103 on TechNet. Task Scheduler failed to log on the user. For detailed information, see the documentation for Event ID 104 on TechNet. Task Scheduler failed to impersonate a user. For detailed information, see the documentation for Event ID 105 on TechNet. The a user registered the Task Scheduler a task. For detailed information, see the documentation for Event ID 106 on TechNet. Task Scheduler launched an instance of a task due to a time trigger. For detailed information, see the documentation for Event ID 107 on TechNet. Task Scheduler launched an instance of a task due to an event trigger. For detailed information, see the documentation for Event ID 108 on TechNet. Task Scheduler launched an instance of a task due to a registration trigger. For detailed information, see the documentation for Event ID 109 on TechNet. Task Scheduler launched an instance of a task for a user. For detailed information, see the documentation for Event ID 110 on TechNet. Task Scheduler terminated an instance of a task due to exceeding the time allocated for execution, as configured in the task definition. For detailed information, see the documentation for Event ID 111 on TechNet. Task Scheduler could not start a task because the network was unavailable. Ensure the computer is connected to the required network as specified in the task. For detailed information, see the documentation for Event ID 112 on TechNet. The Task Scheduler registered the a task, but not all the specified triggers will start the task. Ensure all the task triggers are valid. For detailed information, see the documentation for Event ID 113 on TechNet. Task Scheduler could not launch a task as scheduled. Instance is started now as required by the configuration option to start the task when available, if the scheduled time is missed. For detailed information, see the documentation for Event ID 114 on TechNet. Task Scheduler failed to roll back a transaction when updating or deleting a task. For detailed information, see the documentation for Event ID 115 on TechNet. Task Scheduler saved the configuration for a task, but the credentials used to run the task could not be stored. For detailed information, see the documentation for Event ID 116 on TechNet. Task Scheduler launched an instance of a task due to an idle condition. For detailed information, see the documentation for Event ID 117 on TechNet. Task Scheduler launched an instance of a task due to system startup. For detailed information, see the documentation for Event ID 118 on TechNet. Task Scheduler launched an instance of a task due to a user logon. For detailed information, see the documentation for Event ID 119 on TechNet. Task Scheduler launched an instance of a task due to a user connecting to the console. For detailed information, see the documentation for Event ID 120 on TechNet. Task Scheduler launched an instance of a task due to a user disconnecting from the console. For detailed information, see the documentation for Event ID 121 on TechNet. Task Scheduler launched an instance of a task due to a user remotely connecting. For detailed information, see the documentation for Event ID 122 on TechNet. Task Scheduler launched an instance of a task due to a user remotely disconnecting. For detailed information, see the documentation for Event ID 123 on TechNet. Task Scheduler launched an instance of a task due to a user locking the computer. For detailed information, see the documentation for Event ID 124 on TechNet. Task Scheduler launched an instance of a task due to a user unlocking the computer. For detailed information, see the documentation for Event ID 125 on TechNet. Task Scheduler failed to execute a task. Task Scheduler is attempting to restart the task. For detailed information, see the documentation for Event ID 126 on TechNet. Task Scheduler failed to execute a task due to a shutdown race condition. Task Scheduler is attempting to restart the task. For detailed information, see the documentation for Event ID 127 on TechNet. Task Scheduler did not launch a task because the current time exceeds the configured task end time. For detailed information, see the documentation for Event ID 128 on TechNet. Task Scheduler launched an instance of a task in a new process. For detailed information, see the documentation for Event ID 129 on TechNet. The Task Scheduler service failed to start a task due to the service being busy. For detailed information, see the documentation for Event ID 130 on TechNet. Task Scheduler failed to start a task because the number of tasks in the task queue exceeds the quota currently configured. For detailed information, see the documentation for Event ID 131 on TechNet. The Task Scheduler task launching queue quota is approaching its preset limit of tasks currently configured. For detailed information, see the documentation for Event ID 132 on TechNet. Task Scheduler failed to start a task in the task engine for a user. For detailed information, see the documentation for Event ID 133 on TechNet. Task Engine for a user is approaching its preset limit of tasks. For detailed information, see the documentation for Event ID 134 on TechNet. Task Scheduler did not launch a task because launch condition not met, machine not idle. For detailed information, see the documentation for Event ID 135 on TechNet. A user updated Task Scheduler a task For detailed information, see the documentation for Event ID 140 on TechNet. A user deleted Task Scheduler a task For detailed information, see the documentation for Event ID 141 on TechNet. A user disabled Task Scheduler a task For detailed information, see the documentation for Event ID 142 on TechNet. Task Scheduler woke up the computer to run a task. For detailed information, see the documentation for Event ID 145 on TechNet. Task Scheduler failed to subscribe the event trigger for a task. For detailed information, see the documentation for Event ID 150 on TechNet. Task Scheduler launched an action in an instance of a task. For detailed information, see the documentation for Event ID 200 on TechNet. Task Scheduler successfully completed a task instance and action. For detailed information, see the documentation for Event ID 201 on TechNet. Task Scheduler failed to complete an instance of a task with an action. For detailed information, see the documentation for Event ID 202 on TechNet. Task Scheduler failed to launch an action in a task instance. For detailed information, see the documentation for Event ID 203 on TechNet. Task Scheduler failed to retrieve the event triggering values for a task . The event will be ignored. For detailed information, see the documentation for Event ID 204 on TechNet. Task Scheduler failed to match the pattern of events for a task. The events will be ignored. For detailed information, see the documentation for Event ID 205 on TechNet. Task Scheduler is shutting down the a task engine. For detailed information, see the documentation for Event ID 301 on TechNet. Task Scheduler is shutting down the a task engine due to an error. For detailed information, see the documentation for Event ID 303 on TechNet. Task Scheduler sent a task to a task engine. For detailed information, see the documentation for Event ID 304 on TechNet. Task Scheduler did not send a task to a task engine. For detailed information, see the documentation for Event ID 305 on TechNet. For a Task Scheduler task engine, the thread pool failed to process the message. For detailed information, see the documentation for Event ID 306 on TechNet. The Task Scheduler service failed to connect to a task engine process. For detailed information, see the documentation for Event ID 307 on TechNet. Task Scheduler connected to a task engine process. For detailed information, see the documentation for Event ID 308 on TechNet. There are Task Scheduler tasks orphaned during a task engine shutdown. For detailed information, see the documentation for Event ID 309 on TechNet. Task Scheduler started a task engine process. For detailed information, see the documentation for Event ID 310 on TechNet. Task Scheduler failed to start a task engine process due to an error. For detailed information, see the documentation for Event ID 311 on TechNet. Task Scheduler created the Win32 job object for a task engine. For detailed information, see the documentation for Event ID 312 on TechNet. The Task Scheduler channel is ready to send and receive messages. For detailed information, see the documentation for Event ID 313 on TechNet. Task Scheduler has no tasks running for a task engine, and the idle timer has started. For detailed information, see the documentation for Event ID 314 on TechNet. A task engine process failed to connect to the Task Scheduler service. For detailed information, see the documentation for Event ID 315 on TechNet. A task engine failed to send a message to the Task Scheduler service. For detailed information, see the documentation for Event ID 316 on TechNet. Task Scheduler started a task engine process. For detailed information, see the documentation for Event ID 317 on TechNet. Task Scheduler shut down a task engine process. For detailed information, see the documentation for Event ID 318 on TechNet. A task engine received a message from the Task Scheduler service requesting to launch a task. For detailed information, see the documentation for Event ID 319 on TechNet. A task engine received a message from the Task Scheduler service requesting to stop a task instance. For detailed information, see the documentation for Event ID 320 on TechNet. Task Scheduler did not launch a task because an instance of the same task is already running. For detailed information, see the documentation for Event ID 322 on TechNet. Task Scheduler stopped an instance of a task in order to launch a new instance. For detailed information, see the documentation for Event ID 323 on TechNet. Task Scheduler queued an instance of a task and will launch it as soon as another instance completes. For detailed information, see the documentation for Event ID 324 on TechNet. Task Scheduler queued an instance of a task that will launch immediately. For detailed information, see the documentation for Event ID 325 on TechNet. Task Scheduler did not launch a task because the computer is running on batteries. If launching the task on batteries is required, change the respective flag in the task configuration. For detailed information, see the documentation for Event ID 326 on TechNet. Task Scheduler stopped an instance of a task because the computer is switching to battery power. For detailed information, see the documentation for Event ID 327 on TechNet. Task Scheduler stopped an instance of a task because the computer is no longer idle. For detailed information, see the documentation for Event ID 328 on TechNet. Task Scheduler stopped an instance of a task because the task timed out. For detailed information, see the documentation for Event ID 329 on TechNet. Task Scheduler stopped an instance of a task as request by a user . For detailed information, see the documentation for Event ID 330 on TechNet. Task Scheduler will continue to execute an instance of a task even after the designated timeout, due to a failure to create the timeout mechanism. For detailed information, see the documentation for Event ID 331 on TechNet. Task Scheduler did not launch a task because a user was not logged on when the launching conditions were met. Ensure the user is logged on or change the task definition to allow the task to launch when the user is logged off. For detailed information, see the documentation for Event ID 332 on TechNet. The Task Scheduler service has started. For detailed information, see the documentation for Event ID 400 on TechNet. The Task Scheduler service failed to start due to an error. For detailed information, see the documentation for Event ID 401 on TechNet. Task Scheduler service is shutting down. For detailed information, see the documentation for Event ID 402 on TechNet. The Task Scheduler service has encountered an error. For detailed information, see the documentation for Event ID 403 on TechNet. The Task Scheduler service has encountered an RPC initialization error. For detailed information, see the documentation for Event ID 404 on TechNet. The Task Scheduler service has failed to initialize COM. For detailed information, see the documentation for Event ID 405 on TechNet. The Task Scheduler service failed to initialize the credentials store. For detailed information, see the documentation for Event ID 406 on TechNet. Task Scheduler service failed to initialize LSA. For detailed information, see the documentation for Event ID 407 on TechNet. Task Scheduler service failed to initialize idle state detection module. Idle tasks may not be started as required. For detailed information, see the documentation for Event ID 408 on TechNet. The Task Scheduler service failed to initialize a time change notification. System time updates may not be picked by the service and task schedules may not be updated. For detailed information, see the documentation for Event ID 409 on TechNet. Task Scheduler service received a time system change notification. For detailed information, see the documentation for Event ID 411 on TechNet. Task Scheduler service failed to launch tasks triggered by computer startup. Restart the Task Scheduler service. For detailed information, see the documentation for Event ID 412 on TechNet. Task Scheduler service started Task Compatibility module. For detailed information, see the documentation for Event ID 700 on TechNet. Task Scheduler service failed to start Task Compatibility module. Tasks may not be able to register on previous Window versions. For detailed information, see the documentation for Event ID 701 on TechNet. Task Scheduler failed to initialize the RPC server for starting the Task Compatibility module. Tasks may not be able to register on previous Window versions. For detailed information, see the documentation for Event ID 702 on TechNet. Task Scheduler failed to initialize Net Schedule API for starting the Task Compatibility module. Tasks may not be able to register on previous Window versions. For detailed information, see the documentation for Event ID 703 on TechNet. Task Scheduler failed to initialize LSA for starting the Task Compatibility module. Tasks may not be able to register on previous Window versions. For detailed information, see the documentation for Event ID 704 on TechNet. Task Scheduler failed to start directory monitoring for the Task Compatibility module. For detailed information, see the documentation for Event ID 705 on TechNet. Task Compatibility module failed to update a task to the required status. For detailed information, see the documentation for Event ID 706 on TechNet. Task Compatibility module failed to delete a task. For detailed information, see the documentation for Event ID 707 on TechNet. Task Compatibility module failed to set a security descriptor for a task. For detailed information, see the documentation for Event ID 708 on TechNet. Task Compatibility module failed to update a task. For detailed information, see the documentation for Event ID 709 on TechNet. Task Compatibility module failed to upgrade existing tasks. Upgrade will be attempted again next time 'Task Scheduler' service starts. For detailed information, see the documentation for Event ID 710 on TechNet. Task Compatibility module failed to upgrade NetSchedule account. For detailed information, see the documentation for Event ID 711 on TechNet. Task Compatibility module failed to read existing store to upgrade tasks. For detailed information, see the documentation for Event ID 712 on TechNet. Task Compatibility module failed to load a task for upgrade. For detailed information, see the documentation for Event ID 713 on TechNet. Task Compatibility module failed to register a task for upgrade. For detailed information, see the documentation for Event ID 714 on TechNet. Task Compatibility module failed to delete LSA store for upgrade. For detailed information, see the documentation for Event ID 715 on TechNet. Task Compatibility module failed to upgrade existing scheduled tasks. For detailed information, see the documentation for Event ID 716 on TechNet. Task Compatibility module failed to determine if upgrade is needed. For detailed information, see the documentation for Event ID 717 on TechNet. Task scheduler was unable to upgrade the credential store from the Beta 2 version. You may need to re-register any tasks that require passwords. For detailed information, see the documentation for Event ID 718 on TechNet. A unknown value. Historical event information for a task. This class wraps and extends the class. For events on systems prior to Windows Vista, this class will only have information for the TaskPath, TimeCreated and EventId properties. Gets the activity id. This value is null for V1 events. An indexer that gets the value of each of the data item values. This value is null for V1 events. The data values. Gets the event id. Gets the underlying . This value is null for V1 events. Gets the from the . The . If not found, returns . Gets the level. This value is null for V1 events. Gets the op code. This value is null for V1 events. Gets the process id. This value is null for V1 events. Gets the record id. This value is null for V1 events. Gets the task category. This value is null for V1 events. Gets the task path. Gets the time created. Gets the user id. This value is null for V1 events. Gets the version. This value is null for V1 events. Gets the data value from the task specific event data item list. The name of the data element. Contents of the requested data element if found. null if no value found. Returns a that represents this instance. A that represents this instance. Compares the current object with another object of the same type. An object to compare with this object. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other. Get indexer class for data values. Gets the value of the specified property name. The value. Name of the property. Value of the specified property name. null if property does not exist. An enumerator over a task's history of events. Gets the element in the collection at the current position of the enumerator. The element in the collection at the current position of the enumerator. Gets the element in the collection at the current position of the enumerator. The element in the collection at the current position of the enumerator. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Advances the enumerator to the next element of the collection. true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. The collection was modified after the enumerator was created. Sets the enumerator to its initial position, which is before the first element in the collection. The collection was modified after the enumerator was created. Seeks the specified bookmark. The bookmark. The offset. Seeks the specified origin. The origin. The offset. Historical event log for a task. Only available for Windows Vista and Windows Server 2008 and later systems. Many applications have the need to audit the execution of the tasks they supply. To enable this, the library provides the TaskEventLog class that allows for TaskEvent instances to be enumerated. This can be done for single tasks or the entire system. It can also be filtered by specific events or criticality. Initializes a new instance of the class. The task path. This can be retrieved using the property. Thrown when instantiated on an OS prior to Windows Vista. Initializes a new instance of the class. Name of the machine. The task path. This can be retrieved using the property. The domain. The user. The password. Thrown when instantiated on an OS prior to Windows Vista. Initializes a new instance of the class that looks at all task events from a specified time. The start time. Name of the task. Name of the machine (optional). The domain. The user. The password. Initializes a new instance of the class. Name of the task. The event ids. The start time. Name of the machine (optional). The domain. The user. The password. Initializes a new instance of the class. Name of the task. The event ids. The levels. The start time. Name of the machine (optional). The domain. The user. The password. Gets the total number of events for this task. Gets or sets a value indicating whether this is enabled. true if enabled; otherwise, false. Gets or sets a value indicating whether to enumerate in reverse when calling the default enumerator (typically with foreach statement). true if enumerates in reverse (newest to oldest) by default; otherwise, false to enumerate oldest to newest. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through the collection. if set to true reverse. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Information about the task event. If possible, gets the task associated with this event. The task or null if unable to retrieve. Gets the . The TaskEvent. Gets the task name. The task name. Gets the task path. The task path. Watches system events related to tasks and issues a event when the filtered conditions are met. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later. Sometimes, a developer will need to know about events as they occur. In this case, they can use the TaskEventWatcher component that enables the developer to watch a task, a folder, or the entire system for filtered events. Below is information on how to watch a folder for all task events. For a complete example, look at this sample project: TestTaskWatcher.zip Initializes a new instance of the class. If other properties are not set, this will watch for all events for all tasks on the local machine. Initializes a new instance of the class watching only those events for the task with the provided path on the local machine. The full path (folders and name) of the task to watch. The task service. $Invalid task name: {taskPath} Initializes a new instance of the class watching only those events for the specified task. The task to watch. Occurs if the is null. Initializes a new instance of the class watching only those events for the tasks whose name matches the in the specified and optionally all subfolders. The task folder to watch. The filter for task names using standard file system wildcards. Use "*" to include all tasks. if set to true include events from tasks subfolders. Occurs if the is null. Initializes a new instance of the class. The task folder to watch. The filter for task names using standard file system wildcards. Use "*" to include all tasks. if set to true include events from tasks subfolders. The task service. Initializes a new instance of the class on a remote machine. Name of the remote machine. The task path. The domain of the user account. The user name with permissions on the remote machine. The password for the user. Initializes a new instance of the class on a remote machine. Name of the remote machine. The task folder to watch. The filter for task names using standard file system wildcards. Use "*" to include all tasks. if set to true include events from tasks subfolders. The domain of the user account. The user name with permissions on the remote machine. The password for the user. Occurs when a task or the task engine records an event. Gets or sets a value indicating whether the component is enabled. true if enabled; otherwise, false. Gets the filter for this . The filter. Gets or sets the folder to watch. The folder path to watch. This value should include the leading "\" to indicate the root folder. Thrown if the folder specified does not exist or contains invalid characters. Gets or sets a value indicating whether to include events from subfolders when the property is set. If the property is set, this property is ignored. true if include events from subfolders; otherwise, false. Gets or sets the synchronizing object. The synchronizing object. Gets or sets the name of the computer that is running the Task Scheduler service that the user is connected to. Gets or sets the instance associated with this event watcher. Setting this value will override any values set for , , , and and set them to those values in the supplied instance. The TaskService. Gets or sets the user account domain to be used when connecting to the . The user account domain. Gets or sets the user name to be used when connecting to the . The user name. Gets or sets the user password to be used when connecting to the . The user password. Gets a value indicating if watching is available. Signals the object that initialization is starting. Signals the object that initialization is complete. Releases the unmanaged resources used by the FileSystemWatcher and optionally releases the managed resources. true to release both managed and unmanaged resources; false to release only unmanaged resources. Fires the event. The sender. The instance containing the event data. Holds filter information for a . Gets or sets an optional array of event identifiers to use when filtering those events that will fire a event. The array of event identifier filters. All know task event identifiers are declared in the enumeration. Gets or sets an optional array of event levels to use when filtering those events that will fire a event. The array of event levels. While event providers can define custom levels, most will use integers defined in the System.Diagnostics.Eventing.Reader.StandardEventLevel enumeration. Gets or sets the task name, which can utilize wildcards, to look for when watching a folder. A task name or wildcard. Returns a that represents this instance. A that represents this instance. 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. Releases all resources used by this class. Gets a which enumerates all the tasks in this and all subfolders. A for all instances. Gets the name that is used to identify the folder that contains a task. Gets the parent folder of this folder. The parent folder, or null if this folder is the root folder. Gets the path to where the folder is stored. Gets or sets the security descriptor of the task. The security descriptor. Gets all the subfolders in the folder. Gets a collection of all the tasks in the folder. Gets or sets the that manages this task. The task service. Compares the current object with another object of the same type. An object to compare with this object. A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the parameter.Zero This object is equal to . Greater than zero This object is greater than . Creates a folder for related tasks. Not available to Task Scheduler 1.0. The name used to identify the folder. If "FolderName\SubFolder1\SubFolder2" is specified, the entire folder tree will be created if the folders do not exist. This parameter can be a relative path to the current instance. The root task folder is specified with a backslash (\). An example of a task folder path, under the root task folder, is \MyTaskFolder. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The security descriptor associated with the folder. A instance that represents the new subfolder. Creates a folder for related tasks. Not available to Task Scheduler 1.0. The name used to identify the folder. If "FolderName\SubFolder1\SubFolder2" is specified, the entire folder tree will be created if the folders do not exist. This parameter can be a relative path to the current instance. The root task folder is specified with a backslash (\). An example of a task folder path, under the root task folder, is \MyTaskFolder. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The task security associated with the folder. A instance that represents the new subfolder. Creates a folder for related tasks. Not available to Task Scheduler 1.0. The name used to identify the folder. If "FolderName\SubFolder1\SubFolder2" is specified, the entire folder tree will be created if the folders do not exist. This parameter can be a relative path to the current instance. The root task folder is specified with a backslash (\). An example of a task folder path, under the root task folder, is \MyTaskFolder. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The security descriptor associated with the folder. Set this value to false to avoid having an exception called if the folder already exists. A instance that represents the new subfolder. Security descriptor mismatch between specified credentials and credentials on existing folder by same name. Invalid SDDL form. Not supported under Task Scheduler 1.0. Deletes a subfolder from the parent folder. Not available to Task Scheduler 1.0. The name of the subfolder to be removed. The root task folder is specified with a backslash (\). This parameter can be a relative path to the folder you want to delete. An example of a task folder path, under the root task folder, is \MyTaskFolder. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. Set this value to false to avoid having an exception called if the folder does not exist. Not supported under Task Scheduler 1.0. Deletes a task from the folder. The name of the task that is specified when the task was registered. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. Set this value to false to avoid having an exception called if the task does not exist. Returns an enumerable collection of folders that matches a specified filter and recursion option. An optional predicate used to filter the returned instances. An enumerable collection of folders that matches . Returns an enumerable collection of tasks that matches a specified filter and recursion option. An optional predicate used to filter the returned instances. Specifies whether the enumeration should include tasks in any subfolders. An enumerable collection of directories that matches and . Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Gets a object that encapsulates the specified type of access control list (ACL) entries for the task described by the current object. A object that encapsulates the access control rules for the current folder. Gets a object that encapsulates the specified type of access control list (ACL) entries for the task folder described by the current object. One of the values that specifies which group of access control entries to retrieve. A object that encapsulates the access control rules for the current folder. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the security descriptor for the folder. Not available to Task Scheduler 1.0. Section(s) of the security descriptor to return. The security descriptor for the folder. Gets the security descriptor for the folder. Not available to Task Scheduler 1.0. Section(s) of the security descriptor to return. The security descriptor for the folder. Not supported under Task Scheduler 1.0. Gets a collection of all the tasks in the folder whose name matches the optional . The optional name filter expression. Collection of all matching tasks. Imports a from an XML file. The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The file containing the XML-formatted definition of the task. If set to , overwrites any existing task with the same name. A instance that represents the new task. Importing from an XML file is only supported under Task Scheduler 2.0. Registers (creates) a new task in the folder using XML to define the task. The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. An XML-formatted definition of the task. A union of flags. The user credentials used to register the task. The password for the userId used to register the task. A value that defines what logon technique is used to run the registered task. The security descriptor associated with the registered task. You can specify the access control list (ACL) in the security descriptor for a task in order to allow or deny certain users and groups access to a task. A instance that represents the new task. " + "" + " " + " " + " S-1-5-18" + " " + " " + " " + " " + " 2017-09-04T14:04:03" + " " + " " + " " + " " + " " + " cmd" + " " + " " + ""; // Register the task in the root folder of the local machine using the SYSTEM account defined in XML TaskService.Instance.RootFolder.RegisterTaskDefinition("Test", xml); ]]> Registers (creates) a task in a specified location using a instance to define a task. The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The of the registered task. A instance that represents the new task. Registers (creates) a task in a specified location using a instance to define a task. The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The of the registered task. A union of flags. The user credentials used to register the task. The password for the userId used to register the task. A value that defines what logon technique is used to run the registered task. The security descriptor associated with the registered task. You can specify the access control list (ACL) in the security descriptor for a task in order to allow or deny certain users and groups access to a task. A instance that represents the new task. This will return null if is set to ValidateOnly and there are no validation errors. Task names may not include any characters which are invalid for file names. or Task names ending with a period followed by three or fewer characters cannot be retrieved due to a bug in the native library. This LogonType is not supported on Task Scheduler 1.0. or Security settings are not available on Task Scheduler 1.0. or Registration triggers are not available on Task Scheduler 1.0. or XML validation not available on Task Scheduler 1.0. This method is effectively the "Save" method for tasks. It takes a modified TaskDefinition instance and registers it in the folder defined by this TaskFolder instance. Optionally, you can use this method to override the user, password and logon type defined in the definition and supply security against the task. This first example registers a simple task with a single trigger and action using the default security. This example registers that same task using the SYSTEM account. This example registers that same task using a specific username and password along with a security definition. Applies access control list (ACL) entries described by a object to the file described by the current object. A object that describes an access control list (ACL) entry to apply to the current folder. Sets the security descriptor for the folder. Not available to Task Scheduler 1.0. The security descriptor for the folder. Section(s) of the security descriptor to set. Sets the security descriptor for the folder. Not available to Task Scheduler 1.0. The security descriptor for the folder. Flags that specify how to set the security descriptor. Not supported under Task Scheduler 1.0. Returns a that represents this instance. A that represents this instance. Enumerates the tasks in the specified folder and its child folders. The folder in which to start enumeration. An optional filter to apply to the task list. true if subfolders are to be queried recursively. A that can be used to iterate through the tasks. Provides information and control for a collection of folders that contain tasks. Occurs when a collection changes. Occurs when a property value changes. Gets the number of items in the collection. Gets a value indicating whether the is read-only. Gets the specified folder from the collection. The index of the folder to be retrieved. A TaskFolder instance that represents the requested folder. Gets the specified folder from the collection. The path of the folder to be retrieved. A TaskFolder instance that represents the requested folder. Adds an item to the . The object to add to the . This action is technically unfeasible due to limitations of the underlying library. Use the instead. Removes all items from the . Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies the elements of the ICollection to an Array, starting at a particular Array index. The one-dimensional Array that is the destination of the elements copied from . The Array must have zero-based indexing. The zero-based index in array at which copying begins. Releases all resources used by this class. Determines whether the specified folder exists. The path of the folder. true if folder exists; otherwise, false. Gets a list of items in a collection. Enumerated list of items in the collection. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . Called when a property has changed to notify any attached elements. Name of the property. Defines the methods that are called by the Task Scheduler service to manage a COM handler. This interface must be implemented for a task to perform a COM handler action. When the Task Scheduler performs a COM handler action, it creates and activates the handler and calls the methods of this interface as needed. For information on specifying a COM handler action, see the class. Called to start the COM handler. This method must be implemented by the handler. An IUnkown interface that is used to communicate back with the Task Scheduler. The arguments that are required by the handler. These arguments are defined in the property of the COM handler action. Called to stop the COM handler. This method must be implemented by the handler. The return code that the Task Schedule will raise as an event when the COM handler action is completed. Called to pause the COM handler. This method is optional and should only be implemented to give the Task Scheduler the ability to pause and restart the handler. Called to resume the COM handler. This method is optional and should only be implemented to give the Task Scheduler the ability to resume the handler. Provides the methods that are used by COM handlers to notify the Task Scheduler about the status of the handler. Tells the Task Scheduler about the percentage of completion of the COM handler. A value that indicates the percentage of completion for the COM handler. The message that is displayed in the Task Scheduler UI. Tells the Task Scheduler that the COM handler is completed. The error code that the Task Scheduler will raise as an event. Specifies the access control rights that can be applied to Task Scheduler tasks. Specifies the right to exert full control over a task folder or task, and to modify access control and audit rules. This value represents the right to do anything with a task and is the combination of all rights in this enumeration. Specifies the right to create tasks and folders, and to add or remove data from tasks. This right includes the following rights: . Specifies the right to open and copy folders or tasks as read-only. This right includes the following rights: . Specifies the right run tasks. This right includes the following rights: . The right to wait on a task. The right to change the owner of a task. Specifies the right to change the security and audit rules associated with a task or folder. The right to open and copy the access rules and audit rules for a task. The right to delete a folder or task. Specifies the right to open and write file system attributes to a folder or file. This does not include the ability to write data, extended attributes, or access and audit rules. Specifies the right to open and copy file system attributes from a folder or task. For example, this value specifies the right to view the file creation or modified date. This does not include the right to read data, extended file system attributes, or access and audit rules. Specifies the right to delete a folder and any tasks contained within that folder. Specifies the right to run a task. Specifies the right to open and write extended file system attributes to a folder or file. This does not include the ability to write data, attributes, or access and audit rules. Specifies the right to open and copy extended system attributes from a folder or task. For example, this value specifies the right to view author and content information. This does not include the right to read data, system attributes, or access and audit rules. Specifies the right to append data to the end of a file. Specifies the right to open and write to a file or folder. This does not include the right to open and write file system attributes, extended file system attributes, or access and audit rules. Specifies the right to open and copy a task or folder. This does not include the right to read file system attributes, extended file system attributes, or access and audit rules. Represents a set of access rights allowed or denied for a user or group. This class cannot be inherited. Initializes a new instance of the class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied. The user or group the rule applies to. Must be of type or a type such as that can be converted to type . A bitwise combination of values specifying the rights allowed or denied. One of the values specifying whether the rights are allowed or denied. Initializes a new instance of the class, specifying the name of the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied. The name of the user or group the rule applies to. A bitwise combination of values specifying the rights allowed or denied. One of the values specifying whether the rights are allowed or denied. Gets the rights allowed or denied by the access rule. A bitwise combination of values indicating the rights allowed or denied by the access rule. Represents a set of access rights to be audited for a user or group. This class cannot be inherited. Initializes a new instance of the class, specifying the user or group to audit, the rights to audit, and whether to audit success, failure, or both. The user or group the rule applies to. Must be of type or a type such as that can be converted to type . A bitwise combination of values specifying the kinds of access to audit. The audit flags. Gets the access rights affected by the audit rule. A bitwise combination of values that indicates the rights affected by the audit rule. objects are immutable. You can create a new audit rule representing a different user, different rights, or a different combination of AuditFlags values, but you cannot modify an existing audit rule. Represents the Windows access control security for a Task Scheduler task. This class cannot be inherited. A TaskSecurity object specifies access rights for a Task Scheduler task, and also specifies how access attempts are audited. Access rights to the task are expressed as rules, with each access rule represented by a object. Each auditing rule is represented by a object. This mirrors the underlying Windows security system, in which each securable object has at most one discretionary access control list (DACL) that controls access to the secured object, and at most one system access control list (SACL) that specifies which access attempts are audited. The DACL and SACL are ordered lists of access control entries (ACE) that specify access and auditing for users and groups. A or object might represent more than one ACE. Note A object can represent a local task or a Task Scheduler task. Windows access control security is meaningful only for Task Scheduler tasks. The TaskSecurity, , and classes hide the implementation details of ACLs and ACEs. They allow you to ignore the seventeen different ACE types and the complexity of correctly maintaining inheritance and propagation of access rights. These objects are also designed to prevent the following common access control errors: Creating a security descriptor with a null DACL. A null reference to a DACL allows any user to add access rules to an object, potentially creating a denial-of-service attack. A new TaskSecurity object always starts with an empty DACL, which denies all access for all users. Violating the canonical ordering of ACEs. If the ACE list in the DACL is not kept in the canonical order, users might inadvertently be given access to the secured object. For example, denied access rights must always appear before allowed access rights. TaskSecurity objects maintain the correct order internally. Manipulating security descriptor flags, which should be under resource manager control only. Creating invalid combinations of ACE flags. Manipulating inherited ACEs. Inheritance and propagation are handled by the resource manager, in response to changes you make to access and audit rules. Inserting meaningless ACEs into ACLs. The only capabilities not supported by the .NET security objects are dangerous activities that should be avoided by the majority of application developers, such as the following: Low-level tasks that are normally performed by the resource manager. Adding or removing access control entries in ways that do not maintain the canonical ordering. To modify Windows access control security for a task, use the method to get the TaskSecurity object. Modify the security object by adding and removing rules, and then use the method to reattach it. Important: Changes you make to a TaskSecurity object do not affect the access levels of the task until you call the method to assign the altered security object to the task. To copy access control security from one task to another, use the method to get a TaskSecurity object representing the access and audit rules for the first task, then use the method, or a constructor that accepts a TaskSecurity object, to assign those rules to the second task. Users with an investment in the security descriptor definition language (SDDL) can use the method to set access rules for a task, and the method to obtain a string that represents the access rules in SDDL format. This is not recommended for new development. Initializes a new instance of the class with default values. Initializes a new instance of the class with the specified sections of the access control security rules from the specified task. The task. The sections of the ACL to retrieve. Initializes a new instance of the class with the specified sections of the access control security rules from the specified task. The folder. The sections of the ACL to retrieve. Gets the enumeration that the class uses to represent access rights. A object representing the enumeration. Gets the type that the TaskSecurity class uses to represent access rules. A object representing the class. Gets the type that the TaskSecurity class uses to represent audit rules. A object representing the class. Gets a object that represent the default access rights. The default task security. Creates a new access control rule for the specified user, with the specified access rights, access control, and flags. An that identifies the user or group the rule applies to. A bitwise combination of values specifying the access rights to allow or deny, cast to an integer. Meaningless for tasks, because they have no hierarchy. Meaningless for tasks, because they have no hierarchy. Meaningless for tasks, because they have no hierarchy. One of the values specifying whether the rights are allowed or denied. The object that this method creates. Searches for a matching rule with which the new rule can be merged. If none are found, adds the new rule. The access control rule to add. Searches for an audit rule with which the new rule can be merged. If none are found, adds the new rule. The audit rule to add. The user specified by this rule determines the search. Creates a new audit rule, specifying the user the rule applies to, the access rights to audit, and the outcome that triggers the audit rule. An that identifies the user or group the rule applies to. A bitwise combination of values specifying the access rights to audit, cast to an integer. Meaningless for tasks, because they have no hierarchy. Meaningless for tasks, because they have no hierarchy. Meaningless for tasks, because they have no hierarchy. One of the values specifying whether to audit successful access, failed access, or both. A object representing the specified audit rule for the specified user. The return type of the method is the base class, , but the return value can be cast safely to the derived class. Searches for an access control rule with the same user and (allow or deny) as the specified rule, and with compatible inheritance and propagation flags; if such a rule is found, the rights contained in the specified access rule are removed from it. A that specifies the user and to search for, and a set of inheritance and propagation flags that a matching rule, if found, must be compatible with. Specifies the rights to remove from the compatible rule, if found. true if a compatible rule is found; otherwise false. Searches for all access control rules with the same user and (allow or deny) as the specified rule and, if found, removes them. A that specifies the user and to search for, and a set of inheritance and propagation flags that a matching rule, if found, must be compatible with. Any rights specified by this rule are ignored. Searches for an access control rule that exactly matches the specified rule and, if found, removes it. The to remove. Searches for an audit control rule with the same user as the specified rule, and with compatible inheritance and propagation flags; if a compatible rule is found, the rights contained in the specified rule are removed from it. A that specifies the user to search for, and a set of inheritance and propagation flags that a matching rule, if found, must be compatible with. Specifies the rights to remove from the compatible rule, if found. true if a compatible rule is found; otherwise false. Searches for all audit rules with the same user as the specified rule and, if found, removes them. A that specifies the user to search for. Any rights specified by this rule are ignored. Searches for an audit rule that exactly matches the specified rule and, if found, removes it. The to remove. Removes all access control rules with the same user as the specified rule, regardless of , and then adds the specified rule. The to add. The user specified by this rule determines the rules to remove before this rule is added. Removes all access control rules with the same user and (allow or deny) as the specified rule, and then adds the specified rule. The to add. The user and of this rule determine the rules to remove before this rule is added. Removes all audit rules with the same user as the specified rule, regardless of the value, and then adds the specified rule. The to add. The user specified by this rule determines the rules to remove before this rule is added. Returns a that represents this instance. A that represents this instance. Saves the specified sections of the security descriptor associated with this object to permanent storage. We recommend that the values of the parameters passed to the constructor and persist methods be identical. The task used to retrieve the persisted information. One of the enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save. Saves the specified sections of the security descriptor associated with this object to permanent storage. We recommend that the values of the parameters passed to the constructor and persist methods be identical. The task folder used to retrieve the persisted information. One of the enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save. Saves the specified sections of the security descriptor associated with this object to permanent storage. We recommend that the values of the parameters passed to the constructor and persist methods be identical. For more information, see Remarks. The name used to retrieve the persisted information. One of the enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save. Quick simple trigger types for the method. At boot. On system idle. At logon of any user. When the task is registered. Hourly, starting now. Daily, starting now. Weekly, starting now. Monthly, starting now. Known versions of the native Task Scheduler library. This can be used as a decoder for the and values. Task Scheduler 1.0 (Windows Server™ 2003, Windows® XP, or Windows® 2000). Task Scheduler 2.0 (Windows Vista™, Windows Server™ 2008). Task Scheduler 2.1 (Windows® 7, Windows Server™ 2008 R2). Task Scheduler 2.2 (Windows® 8.x, Windows Server™ 2012). Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016). Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016 post build 1703). Provides access to the Task Scheduler service for managing registered tasks. Creates a new instance of a TaskService connecting to the local machine as the current user. Initializes a new instance of the class. The name of the computer that you want to connect to. If the this parameter is empty, then this will connect to the local computer. The user name that is used during the connection to the computer. If the user is not specified, then the current token is used. The domain of the user specified in the parameter. The password that is used to connect to the computer. If the user name and password are not specified, then the current token is used. If set to true force Task Scheduler 1.0 compatibility. Delegate for methods that support update calls during COM handler execution. The percentage of completion (0 to 100). An optional message. Occurs when the Task Scheduler is connected to the local or remote target. Occurs when the Task Scheduler is disconnected from the local or remote target. Gets a local instance of the using the current user's credentials. Local user instance. Gets the library version. This is the highest version supported by the local library. Tasks cannot be created using any compatibility level higher than this version. The library version. The following table list the various versions and their host operating system: Version Operating System 1.1 Task Scheduler 1.0 (Windows Server™ 2003, Windows® XP, or Windows® 2000). 1.2 Task Scheduler 2.0 (Windows Vista™, Windows Server™ 2008). 1.3 Task Scheduler 2.1 (Windows® 7, Windows Server™ 2008 R2). 1.4 Task Scheduler 2.2 (Windows® 8.x, Windows Server™ 2012). 1.5 Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016). 1.6 Task Scheduler 2.4 (Windows® 10 Version 1703, Windows Server™ 2016 Version 1703). Gets or sets a value indicating whether to allow tasks from later OS versions with new properties to be retrieved as read only tasks. true if allow read only tasks; otherwise, false. Gets the name of the domain to which the computer is connected. Gets the name of the user that is connected to the Task Scheduler service. Gets the highest version of Task Scheduler that a computer supports. The following table list the various versions and their host operating system: Version Operating System 1.1 Task Scheduler 1.0 (Windows Server™ 2003, Windows® XP, or Windows® 2000). 1.2 Task Scheduler 2.0 (Windows Vista™, Windows Server™ 2008). 1.3 Task Scheduler 2.1 (Windows® 7, Windows Server™ 2008 R2). 1.4 Task Scheduler 2.2 (Windows® 8.x, Windows Server™ 2012). 1.5 Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016). 1.6 Task Scheduler 2.4 (Windows® 10 Version 1703, Windows Server™ 2016 Version 1703). Gets the root ("\") folder. For Task Scheduler 1.0, this is the only folder. Gets or sets the name of the computer that is running the Task Scheduler service that the user is connected to. Gets or sets the user account domain to be used when connecting to the . The user account domain. Gets or sets the user name to be used when connecting to the . The user name. Gets or sets the user password to be used when connecting to the . The user password. Gets a which enumerates all the tasks in all folders. A for all instances. Gets a Boolean value that indicates if you are connected to the Task Scheduler service. Gets the connection token for this instance. This token is thread safe and can be used to create new instances on other threads using the static method. The connection token. Gets a value indicating whether the component can raise an event. Creates a new instance from a token. Given that a TaskService instance is thread specific, this is the preferred method for multi-thread creation or asynchronous method parameters. The token. A instance valid for the thread calling this method. Gets a formatted string that tells the Task Scheduler to retrieve a string from a resource .dll file. The path to the .dll file that contains the resource. The identifier for the resource text (typically a negative number). A string in the format of $(@ [dllPath], [resourceId]). For example, the setting this property value to $(@ %SystemRoot%\System32\ResourceName.dll, -101) will set the property to the value of the resource text with an identifier equal to -101 in the %SystemRoot%\System32\ResourceName.dll file. Runs an action that is defined via a COM handler. COM CLSID must be registered to an object that implements the interface. The CLSID of the COM object. An optional string passed to the COM object at startup. The number of milliseconds to wait or -1 for indefinitely. An optional delegate that is called when the COM object calls the method. The value set by the COM object via a call to the method. Runs an action that is defined via a COM handler. COM CLSID must be registered to an object that implements the interface. The CLSID of the COM object. The action to run on thread completion. An optional string passed to the COM object at startup. The number of milliseconds to wait or -1 for indefinitely. An optional delegate that is called when the COM object calls the method. Adds or updates an Automatic Maintenance Task on the connected machine. Name of the task with full path. The amount of time the task needs once executed during regular Automatic maintenance. The amount of time after which the Task Scheduler attempts to run the task during emergency Automatic maintenance, if the task failed to complete during regular Automatic Maintenance. The path to an executable file. The arguments associated with the command-line operation. The directory that contains either the executable file or the files that are used by the executable file. A instance of the Automatic Maintenance Task. Automatic Maintenance tasks are only supported on Windows 8/Server 2012 and later. Creates a new task, registers the task, and returns the instance. The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The to determine when to run the task. The to determine what happens when the task is triggered. The user credentials used to register the task. The password for the userId used to register the task. A value that defines what logon technique is used to run the registered task. The task description. A instance of the registered task. This method is shorthand for creating a new TaskDescription, adding a trigger and action, and then registering it in the root folder. Creates a new task, registers the task, and returns the instance. The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. The to determine when to run the task. The executable path. The arguments (optional). Value can be NULL. The user credentials used to register the task. The password for the userId used to register the task. A value that defines what logon technique is used to run the registered task. The task description. A instance of the registered task. Signals the object that initialization is starting. Signals the object that initialization is complete. Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Finds all tasks matching a name or standard wildcards. Name of the task in regular expression form. if set to true search all sub folders. An array of containing all tasks matching . Finds all tasks matching a name or standard wildcards. The filter used to determine tasks to select. if set to true search all sub folders. An array of containing all tasks matching . Finds a task given a name and standard wildcards. The task name. This can include the wildcards * or ?. if set to true search all sub folders. A if one matches , otherwise NULL. Gets the event log for this instance. (Optional) The task path if only the events for a single task are desired. A instance. Gets the path to a folder of registered tasks. The path to the folder to retrieve. Do not use a backslash following the last folder name in the path. The root task folder is specified with a backslash (\). An example of a task folder path, under the root task folder, is \MyTaskFolder. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. instance for the requested folder or null if was unrecognized. Folder other than the root (\) was requested on a system not supporting Task Scheduler 2.0. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets a collection of running tasks. True to include hidden tasks. instance with the list of running tasks. Gets the task with the specified path. The task path. The instance matching the , if found. If not found, this method returns null. Returns an empty task definition object to be filled in with settings and properties and then registered using the method. A instance for setting properties. Returns a populated with the properties defined in an XML file. The XML file to use as input. A instance. Importing from an XML file is only supported under Task Scheduler 2.0. Starts the Task Scheduler UI for the OS hosting the assembly if the session is running in interactive mode. Releases the unmanaged resources used by the and optionally releases the managed resources. true to release both managed and unmanaged resources; false to release only unmanaged resources. Connects this instance of the class to a running Task Scheduler. Finds the task in folder. The folder. The wildcard expression to compare task names with. The results. if set to true recurse folders. True if any tasks are found, False if not. Finds the task in folder. The folder. The filter to use when looking for tasks. The results. if set to true recurse folders. True if any tasks are found, False if not. 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 between threads. Initial call for a Fluent model of creating a task. The path of the program to run. An instance. Abstract base class which provides the common properties that are inherited by all trigger classes. A trigger can be created using the or the method. Creates a trigger using a cron string. String using cron defined syntax for specifying a time interval. See remarks for syntax. Array of representing the specified cron string. Unsupported cron string. This method does not support all combinations of cron strings. Please test extensively before use. Please post an issue with any syntax that should work, but doesn't. The following combinations are known not to work: Intervals on months (e.g. "* * * */5 *") Intervals on DOW (e.g. "* * * * MON/3") This section borrows liberally from the site http://www.nncron.ru/help/EN/working/cron-format.htm. The cron format consists of five fields separated by white spaces: <Minute> <Hour> <Day_of_the_Month> <Month_of_the_Year> <Day_of_the_Week> Each item has bounds as defined by the following: * * * * * | | | | | | | | | +---- Day of the Week (range: 1-7, 1 standing for Monday) | | | +------ Month of the Year (range: 1-12) | | +-------- Day of the Month (range: 1-31) | +---------- Hour (range: 0-23) +------------ Minute (range: 0-59) Any of these 5 fields may be an asterisk (*). This would mean the entire range of possible values, i.e. each minute, each hour, etc. Any of the first 4 fields can be a question mark ("?"). It stands for the current time, i.e. when a field is processed, the current time will be substituted for the question mark: minutes for Minute field, hour for Hour field, day of the month for Day of month field and month for Month field. Any field may contain a list of values separated by commas, (e.g. 1,3,7) or a range of values (two integers separated by a hyphen, e.g. 1-5). After an asterisk (*) or a range of values, you can use character / to specify that values are repeated over and over with a certain interval between them. For example, you can write "0-23/2" in Hour field to specify that some action should be performed every two hours (it will have the same effect as "0,2,4,6,8,10,12,14,16,18,20,22"); value "*/4" in Minute field means that the action should be performed every 4 minutes, "1-30/3" means the same as "1,4,7,10,13,16,19,22,25,28". In testing and may change. Do not use until officially introduced into library. Occurs when a property value changes. Gets or sets a Boolean value that indicates whether the trigger is enabled. Gets or sets the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated. While the maximum value for this property is , the Windows Task Scheduler management application that is part of the OS will fail if this value is greater than December 31, 9998. Version 1 (1.1 on all systems prior to Vista) of the native library only allows for the Day, Month and Year values of the structure. Version 2 (1.2 or higher) of the native library only allows for both date and time and all values. However, the user interface and methods will always show the time translated to local time. The library makes every attempt to maintain the Kind value. When using the UI elements provided in the TaskSchedulerEditor library, the "Synchronize across time zones" checkbox will be checked if the Kind is Local or Utc. If the Kind is Unspecified and the user selects the checkbox, the Kind will be changed to Utc and the time adjusted from the value displayed as the local time. Gets or sets the maximum amount of time that the task launched by this trigger is allowed to run. Not available with Task Scheduler 1.0. Not supported under Task Scheduler 1.0. Gets or sets the identifier for the trigger. Cannot set with Task Scheduler 1.0. Not supported under Task Scheduler 1.0. Gets a instance that indicates how often the task is run and how long the repetition pattern is repeated after the task is started. Gets or sets the date and time when the trigger is activated. Version 1 (1.1 on all systems prior to Vista) of the native library only allows for values where the is unspecified. If the DateTime value Kind is then it will be used as is. If the DateTime value Kind is then it will be converted to the local time and then used. Version 2 (1.2 or higher) of the native library only allows for all values. However, the user interface and methods will always show the time translated to local time. The library makes every attempt to maintain the Kind value. When using the UI elements provided in the TaskSchedulerEditor library, the "Synchronize across time zones" checkbox will be checked if the Kind is Local or Utc. If the Kind is Unspecified and the user selects the checkbox, the Kind will be changed to Utc and the time adjusted from the value displayed as the local time. Under Version 2, when converting the string used in the native library for this value (ITrigger.Startboundary) this library will behave as follows: YYYY-MM-DDTHH:MM:SS format uses DateTimeKind.Unspecified and the time specified. YYYY-MM-DDTHH:MM:SSZ format uses DateTimeKind.Utc and the time specified as the GMT time. YYYY-MM-DDTHH:MM:SS±HH:MM format uses DateTimeKind.Local and the time specified in that time zone. Gets the type of the trigger. The of the trigger. Creates the specified trigger. Type of the trigger to instantiate. of specified type. Creates a new that is an unbound copy of this instance. A new that is an unbound copy of this instance. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A value that indicates the relative order of the objects being compared. Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Releases all resources used by this class. Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Sets the repetition. The amount of time between each restart of the task. The maximum time allowed is 31 days, and the minimum time allowed is 1 minute. The duration of how long the pattern is repeated. The minimum time allowed is one minute. If TimeSpan.Zero is specified, the pattern is repeated indefinitely. if set to true the running instance of the task is stopped at the end of repetition pattern duration. Returns a string representing this trigger. String value of trigger. Returns a that represents this trigger in a specific language. The language of the resulting string. String value of trigger. Gets the best time span string. The to display. Either the full string representation created by TimeSpan2 or the default TimeSpan representation. Assigns the unbound TriggerData structure to the V1 trigger instance. Checks the bind value for any conversion. The key (property) name. The value. Gets the unbound value or a default. Return type. The property name. The default value if not found in unbound value list. The unbound value, if set, or the default value. Called when a property has changed to notify any attached elements. Name of the property. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Fluent helper class. Not intended for use. Adds a trigger that executes at logon of all users. instance. Adds a trigger that executes at logon of a specific user. The user id. instance. Adds a trigger that executes at task registration. instance. Adds a trigger that executes every day or week. The interval of days or weeks. instance. Adds a trigger that executes monthly on specific days. The months of the year in which to run. instance. Adds a working directory to the . The directory. instance. Adds a trigger that executes monthly on certain days of the week. The days of the week on which to run. instance. Adds a trigger that executes at system startup. instance. Adds a trigger that executes once at a specific time. instance. Adds a trigger that executes when system is idle. instance. Adds a trigger that executes once at specified state change. Type of the change. instance. Adds arguments to the . The arguments. instance. Fluent helper class. Not intended for use. Transitions to settings syntax. Assigns the name of the task and registers it. The name. A registered instance. Assigns the name of the task and registers it. The name. A union of flags. The user credentials used to register the task. The password for the userId used to register the task. A value that defines what logon technique is used to run the registered task. A registered instance. Fluent helper class. Not intended for use. Specifies that an Every target uses days as the interval. instance. Specifies that an Every target uses weeks as the interval. instance. Fluent helper class. Not intended for use. Updates a monthly trigger to specify in which weeks of the month it will run. The week. instance. Updates a monthly trigger to specify the months of the year in which it will run. The month of the year. instance. Fluent helper class. Not intended for use. Updates a monthly trigger to specify the days of the month on which it will run. The days. instance. Fluent helper class. Not intended for use. Indicates that the task will be started even if the computer is running on battery power. instance. Indicates that the task will be started even if the task is triggered to run in a Remote Applications Integrated Locally (RAIL) session. instance. Sets the task data to a string. instance. Sets the amount of time that the Task Scheduler will wait before deleting the task after it expires. instance. Indicates that the task cannot be started with the Run command or the Context menu. instance. Indicates that the task may not be terminated by using TerminateProcess. instance. Sets the amount of time that is allowed to complete the task. instance. Sets the policy that defines how the Task Scheduler handles multiple instances of the task. instance. Indicates that the task will not be stopped if the computer switches to battery power. instance. Indicates that the Task Scheduler will run the task only if the computer is in an idle condition. instance. Indicates that the Task Scheduler will run the task only when a network is available. instance. Sets the priority level of the task. instance. Sets a value that specifies how long the Task Scheduler will attempt to restart the task. instance. Indicates that the Task Scheduler can start the task at any time after its scheduled time has passed. instance. Indicates that the Task Scheduler will wake the computer when it is time to run the task. instance. Fluent helper class. Not intended for use. Specifies a date on which a trigger will no longer run. The year. The month. The day. instance. Specifies a date and time on which a trigger will no longer run. The year. The month. The day. The hour. The min. The sec. instance. Specifies a date and time on which a trigger will no longer run. A string representing a DateTime and parsable via . instance. Specifies a date and time on which a trigger will no longer run. The DateTime value. instance. Determines whether this trigger is disabled. instance. Specifies a repetition interval for the trigger. The interval span. instance. Specifies a repetition interval for the trigger. The interval span string. Must be parsable by . instance. Specifies the maximum amount of time to repeat the execution of a trigger. The duration span. instance. Specifies the maximum amount of time to repeat the execution of a trigger. The duration span string. Must be parsable by . instance. Specifies a date on which a trigger will start. The year. The month. The day. instance. Specifies a date and time on which a trigger will start. The year. The month. The day. The hour. The min. The sec. instance. Specifies a date and time on which a trigger will start. A string representing a DateTime and parsable via . instance. Specifies a date and time on which a trigger will start. The DateTime value. instance. Fluent helper class. Not intended for use. Updates a weekly trigger to specify the days of the week on which it will run. The days of the week. instance. Fluent helper class. Not intended for use. Values for days of the week (Monday, Tuesday, etc.) Sunday Monday Tuesday Wednesday Thursday Friday Saturday All days Values for months of the year (January, February, etc.) January February March April May June July August September October November December All months Defines the type of triggers that can be used by tasks. Triggers the task when a specific event occurs. Version 1.2 only. Triggers the task at a specific time of day. Triggers the task on a daily schedule. Triggers the task on a weekly schedule. Triggers the task on a monthly schedule. Triggers the task on a monthly day-of-week schedule. Triggers the task when the computer goes into an idle state. Triggers the task when the task is registered. Version 1.2 only. Triggers the task when the computer boots. Triggers the task when a specific user logs on. Triggers the task when a specific user session state changes. Version 1.2 only. Triggers the custom trigger. Version 1.3 only. Values for week of month (first, second, ..., last) First week of the month Second week of the month Third week of the month Fourth week of the month Last week of the month Every week of the month Interface that categorizes the trigger as a calendar trigger. Interface for triggers that support a delay. Gets or sets a value that indicates the amount of time before the task is started. The delay duration. Interface for triggers that support a user identifier. Gets or sets the user for the . Represents a trigger that starts a task when the system is booted. A BootTrigger will fire when the system starts. It can only be delayed. All triggers that support a delay implement the ITriggerDelay interface. Creates an unbound instance of a . Gets or sets a value that indicates the amount of time between when the system is booted and when the task is started. Not supported under Task Scheduler 1.0. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Represents a custom trigger. This class is based on undocumented features and may change. This type of trigger is only available for reading custom triggers. It cannot be used to create custom triggers. Gets a value that indicates the amount of time between the trigger events and when the task is started. This value cannot be set. Gets the name of the custom trigger type. The name of the XML element representing this custom trigger. Gets the properties from the XML definition if possible. Clones this instance. This method will always throw an exception. CustomTrigger cannot be cloned due to OS restrictions. Updates custom properties from XML provided by definition. The XML from the TaskDefinition. Gets the non-localized trigger string for V2 triggers. String describing the trigger. 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. A DailyTrigger will fire at a specified time every day or interval of days. Creates an unbound instance of a . Interval between the days in the schedule. Sets or retrieves the interval between the days in the schedule. Gets or sets a delay time that is randomly added to the start time of the trigger. Not supported under Task Scheduler 1.0. Gets or sets a value that indicates the amount of time before the task is started. The delay duration. Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Represents a trigger that starts a task when a system event occurs. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later. The EventTrigger runs when a system event fires. "; eTrigger.ValueQueries.Add("Name", "Value"); ]]> Creates an unbound instance of a . Initializes an unbound instance of the class and sets a basic event. The event's log. The event's source. Can be null. The event's id. Can be null. Gets or sets a value that indicates the amount of time between when the system is booted and when the task is started. Gets or sets the XPath query string that identifies the event that fires the trigger. Gets a collection of named XPath queries. Each query in the collection is applied to the last matching event XML returned from the subscription query specified in the Subscription property. The name of the query can be used as a variable in the message of a action. Builds an event log XML query string based on the input parameters. The event's log. The event's source. Can be null. The event's id. Can be null. XML query string. log Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets basic event information. The event's log. The event's source. Can be null. The event's id. Can be null. true if subscription represents a basic event, false if not. Sets the subscription for a basic event. This will replace the contents of the property and clear all entries in the property. The event's log. The event's source. Can be null. The event's id. Can be null. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Represents a trigger that starts a task when the computer goes into an idle state. For information about idle conditions, see Task Idle Conditions. An IdleTrigger will fire when the system becomes idle. It is generally a good practice to set a limit on how long it can run using the ExecutionTimeLimit property. Creates an unbound instance of a . Gets the non-localized trigger string for V2 triggers. String describing the trigger. 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. A LogonTrigger will fire after a user logs on. It can only be delayed. Under V2, you can specify which user it applies to. Creates an unbound instance of a . Gets or sets a value that indicates the amount of time between when the system is booted and when the task is started. Not supported under Task Scheduler 1.0. Gets or sets The identifier of the user. For example, "MyDomain\MyName" or for a local account, "Administrator". This property can be in one of the following formats: • User name or SID: The task is started when the user logs on to the computer. • NULL: The task is started when any user logs on to the computer. If you want a task to be triggered when any member of a group logs on to the computer rather than when a specific user logs on, then do not assign a value to the LogonTrigger.UserId property. Instead, create a logon trigger with an empty LogonTrigger.UserId property and assign a value to the principal for the task using the Principal.GroupId property. Not supported under Task Scheduler 1.0. Gets the non-localized trigger string for V2 triggers. String describing the trigger. 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. Creates an unbound instance of a . The days of the week. The months of the year. The weeks of the month. Gets or sets the days of the week during which the task runs. Gets or sets the months of the year during which the task runs. Gets or sets a delay time that is randomly added to the start time of the trigger. Not supported under Task Scheduler 1.0. Gets or sets a Boolean value that indicates that the task runs on the last week of the month. Not supported under Task Scheduler 1.0. Gets or sets the weeks of the month during which the task runs. Gets or sets a value that indicates the amount of time before the task is started. The delay duration. Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Reads the subclass XML for V1 streams. The reader. Writes the subclass XML for V1 streams. The writer. Represents a trigger that starts a job based on a monthly schedule. For example, the task starts on specific days of specific months. Creates an unbound instance of a . The day of the month. This must be a value between 1 and 32. If this value is set to 32, then the value will be set and no days will be added regardless of the month. The months of the year. Gets or sets the days of the month during which the task runs. Gets or sets the months of the year during which the task runs. Gets or sets a delay time that is randomly added to the start time of the trigger. Not supported under Task Scheduler 1.0. Gets or sets a Boolean value that indicates that the task runs on the last day of the month. Not supported under Task Scheduler 1.0. Gets or sets a value that indicates the amount of time before the task is started. The delay duration. Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Converts an array of bit indices into a mask with bits turned ON at every index contained in the array. Indices must be from 1 to 32 and bits are numbered the same. An array with an element for each bit of the mask which is ON. An integer to be interpreted as a mask. Compares two collections. Item type of collections. The first collection. The second collection true if the collections values are equal; false otherwise. Convert an integer representing a mask to an array where each element contains the index of a bit that is ON in the mask. Bits are considered to number from 1 to 32. An integer to be interpreted as a mask. An array with an element for each bit of the mask which is ON. Reads the subclass XML for V1 streams. The reader. Represents a trigger that starts a task when the task is registered or updated. Not available on Task Scheduler 1.0. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later. The RegistrationTrigger will fire after the task is registered (saved). It is advisable to put in a delay. Creates an unbound instance of a . Gets or sets a value that indicates the amount of time between when the system is booted and when the task is started. Not supported under Task Scheduler 1.0. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Defines how often the task is run and how long the repetition pattern is repeated after the task is started. This can be used directly or by assignment for a . Initializes a new instance of the class. The amount of time between each restart of the task. The maximum time allowed is 31 days, and the minimum time allowed is 1 minute. The duration of how long the pattern is repeated. The minimum time allowed is one minute. If TimeSpan.Zero is specified, the pattern is repeated indefinitely. If set to true the running instance of the task is stopped at the end of repetition pattern duration. Occurs when a property value changes. Gets or sets how long the pattern is repeated. The duration that the pattern is repeated. The minimum time allowed is one minute. If TimeSpan.Zero is specified, the pattern is repeated indefinitely. If you specify a repetition duration for a task, you must also specify the repetition interval. Gets or sets the amount of time between each restart of the task. The amount of time between each restart of the task. The maximum time allowed is 31 days, and the minimum time allowed is 1 minute. If you specify a repetition duration for a task, you must also specify the repetition interval. The maximum time allowed is 31 days, and the minimum time allowed is 1 minute. Gets or sets a Boolean value that indicates if a running instance of the task is stopped at the end of repetition pattern duration. Releases all resources used by this class. Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Determines whether any properties for this have been set. true if properties have been set; otherwise, false. Called when a property has changed to notify any attached elements. Name of the property. Triggers tasks for console connect or disconnect, remote connect or disconnect, or workstation lock or unlock notifications. Only available for Task Scheduler 2.0 on Windows Vista or Windows Server 2003 and later. The SessionStateChangeTrigger will fire after six different system events: connecting or disconnecting locally or remotely, or locking or unlocking the session. Creates an unbound instance of a . Initializes a new instance of the class. The state change. The user identifier. Gets or sets a value that indicates the amount of time between when the system is booted and when the task is started. Gets or sets the kind of Terminal Server session change that would trigger a task launch. Gets or sets the user for the Terminal Server session. When a session state change is detected for this user, a task is started. Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Returns a value indicating if the StateChange property has been set. StateChange property has been set. Represents a trigger that starts a task at a specific date and time. A TimeTrigger runs at a specified date and time. Creates an unbound instance of a . Creates an unbound instance of a and assigns the execution time. Date and time for the trigger to fire. Gets or sets a delay time that is randomly added to the start time of the trigger. Not supported under Task Scheduler 1.0. Gets or sets a value that indicates the amount of time before the task is started. The delay duration. Gets the non-localized trigger string for V2 triggers. String describing the trigger. 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. A WeeklyTrigger runs at a specified time on specified days of the week every week or interval of weeks. Creates an unbound instance of a . The days of the week. The interval between the weeks in the schedule. Gets or sets the days of the week on which the task runs. Gets or sets a delay time that is randomly added to the start time of the trigger. Not supported under Task Scheduler 1.0. Gets or sets the interval between the weeks in the schedule. Gets or sets a value that indicates the amount of time before the task is started. The delay duration. Copies the properties from another the current instance. This will not copy any properties associated with any derived triggers except those supporting the interface. The source . Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Gets the non-localized trigger string for V2 triggers. String describing the trigger. Reads the subclass XML for V1 streams. The reader. Writes the subclass XML for V1 streams. The writer. Provides the methods that are used to add to, remove from, and get the triggers of a task. Occurs when a collection changes. Occurs when a property value changes. Gets the number of triggers in the collection. Gets or sets a specified trigger from the collection. The . The id ( ) of the trigger to be retrieved. Specialized instance. Mismatching Id for trigger and lookup. Gets a specified trigger from the collection. The index of the trigger to be retrieved. Specialized instance. Add an unbound to the task. A type derived from . derivative to add to the task. Bound trigger. unboundTrigger is null. Add a new trigger to the collections of triggers for the task. The type of trigger to create. A instance of the specified type. Adds a collection of unbound triggers to the end of the . The triggers to be added to the end of the . The collection itself cannot be null and cannot contain null elements. is null. Clears all triggers from the task. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Determines whether the specified trigger type is contained in this collection. Type of the trigger. true if the specified trigger type is contained in this collection; otherwise, false. Copies the elements of the to an , starting at a particular index. The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. The zero-based index in at which copying begins. Copies the elements of the to a array, starting at a particular array index. The zero-based index in the source at which copying begins. The array that is the destination of the elements copied from . The array must have zero-based indexing. The zero-based index in array at which copying begins. The number of elements to copy. is null. is less than 0. The number of elements in the source is greater than the available space from to the end of the destination . Releases all resources used by this class. Searches for an that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire collection. The delegate that defines the conditions of the to search for. The first that matches the conditions defined by the specified predicate, if found; otherwise, null. Searches for an that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the collection that starts at the specified index and contains the specified number of elements. The zero-based starting index of the search. The number of elements in the collection to search. The delegate that defines the conditions of the element to search for. The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. Searches for an that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the collection. The delegate that defines the conditions of the element to search for. The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. Gets the collection enumerator for this collection. The for this collection. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Determines the index of a specific item in the . The id ( ) of the trigger to be retrieved. The index of if found in the list; otherwise, -1. Inserts an trigger at the specified index. The zero-based index at which trigger should be inserted. The trigger to insert into the list. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . Removes the trigger at a specified index. Index of trigger to remove. Index out of range. Copies the elements of the to a new array. An array containing copies of the elements of the . Returns a that represents the triggers in this collection. A that represents the triggers in this collection. Called when a property has changed to notify any attached elements. Name of the property. Releases all resources used by this class. Represents a system account. Initializes a new instance of the class. Name of the user. This can be in the format DOMAIN\username or username@domain.com or username or null (for current user). Initializes a new instance of the class. The . Gets the current user. The current user. Gets the identity. The identity. Gets a value indicating whether this instance is in an administrator role. true if this instance is an admin; otherwise, false. Gets a value indicating whether this instance is the interactive user. true if this instance is the current user; otherwise, false. Gets a value indicating whether this instance is a service account. true if this instance is a service account; otherwise, false. Gets a value indicating whether this instance is the SYSTEM account. true if this instance is the SYSTEM account; otherwise, false. Gets the SID string. The SID string. Gets the NT name (DOMAIN\username). The name of the user. Create a instance from a SID string. The SID string. A instance. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Options for a task, used for the Flags property of a Task. Uses the "Flags" attribute, so these values are combined with |. Some flags are documented as Windows 95 only, but they have a user interface in Windows XP so that may not be true. The interactive flag is set if the task is intended to be displayed to the user. If the flag is not set, no user interface associated with the task is presented to the user when the task is executed. The task will be deleted when there are no more scheduled run times. The task is disabled. This is useful to temporarily prevent a task from running at the scheduled time(s). The task begins only if the computer is not in use at the scheduled start time. Windows 95 only. The task terminates if the computer makes an idle to non-idle transition while the task is running. The computer is not considered idle until the IdleWait triggers' time elapses with no user input. Windows 95 only. For information regarding idle triggers, see . The task does not start if its target computer is running on battery power. Windows 95 only. The task ends, and the associated application quits if the task's target computer switches to battery power. Windows 95 only. The task runs only if the system is docked. Windows 95 only. The work item created will be hidden. The task runs only if there is currently a valid Internet connection. This feature is currently not implemented. The task starts again if the computer makes a non-idle to idle transition before all the task's task_triggers elapse. (Use this flag in conjunction with KillOnIdleEnd.) Windows 95 only. The task runs only if the SYSTEM account is available. The task runs only if the user specified in SetAccountInformation is logged on interactively. This flag has no effect on work items set to run in the local account. Status values returned for a task. Some values have been determined to occur although they do no appear in the Task Scheduler system documentation. The task is ready to run at its next scheduled time. The task is currently running. One or more of the properties that are needed to run this task on a schedule have not been set. The task has not yet run. The task will not run at the scheduled times because it has been disabled. There are no more runs scheduled for this task. The last run of the task was terminated by the user. Either the task has no triggers or the existing triggers are disabled or not set. Event triggers don't have set run times. Valid types of triggers Trigger is set to run the task a single time. Trigger is set to run the task on a daily interval. Trigger is set to run the work item on specific days of a specific week of a specific month. Trigger is set to run the task on a specific day(s) of the month. Trigger is set to run the task on specific days, weeks, and months. Trigger is set to run the task if the system remains idle for the amount of time specified by the idle wait time of the task. Trigger is set to run the task at system startup. Trigger is set to run the task when a user logs on. Represents a wildcard running on the engine. Initializes a wildcard with the given search pattern and options. The wildcard pattern to match. A combination of one or more . Converts a wildcard to a regular expression. The wildcard pattern to convert. A regular expression equivalent of the given wildcard. The GlobalLock function locks a global memory object and returns a pointer to the first byte of the object's memory block. GlobalLock function increments the lock count by one. Needed for the clipboard functions when getting the data from IDataObject The GlobalUnlock function decrements the lock count associated with a memory object. Defines the errors returned by the status member of the DS_NAME_RESULT_ITEM structure. These are potential errors that may be encountered while a name is converted by the DsCrackNames function. The conversion was successful. Generic processing error occurred. The name cannot be found or the caller does not have permission to access the name. The input name is mapped to more than one output name or the desired format did not have a single, unique value for the object found. The input name was found, but the associated output format cannot be found. This can occur if the object does not have all the required attributes. Unable to resolve entire name, but was able to determine in which domain object resides. The caller is expected to retry the call at a domain controller for the specified domain. The entire name cannot be resolved, but the domain that the object resides in could be determined. The pDomain member of the DS_NAME_RESULT_ITEM contains valid data when this error is specified. A syntactical mapping cannot be performed on the client without transmitting over the network. The name is from an external trusted forest. Used to define how the name syntax will be cracked. These flags are used by the DsCrackNames function. Indicate that there are no associated flags. Perform a syntactical mapping at the client without transferring over the network. The only syntactic mapping supported is from DS_FQDN_1779_NAME to DS_CANONICAL_NAME or DS_CANONICAL_NAME_EX. Force a trip to the DC for evaluation, even if this could be locally cracked syntactically. The call fails if the domain controller is not a global catalog server. Enable cross forest trust referral. Provides formats to use for input and output names for the DsCrackNames function. Indicates the name is using an unknown name type. This format can impact performance because it forces the server to attempt to match all possible formats. Only use this value if the input format is unknown. Indicates that the fully qualified distinguished name is used. For example: "CN = someone, OU = Users, DC = Engineering, DC = Fabrikam, DC = Com" Indicates a Windows NT 4.0 account name. For example: "Engineering\someone" The domain-only version includes two trailing backslashes (\\). Indicates a user-friendly display name, for example, Jeff Smith. The display name is not necessarily the same as relative distinguished name (RDN). Indicates a GUID string that the IIDFromString function returns. For example: "{4fa050f0-f561-11cf-bdd9-00aa003a77b6}" Indicates a complete canonical name. For example: "engineering.fabrikam.com/software/someone" The domain-only version includes a trailing forward slash (/). Indicates that it is using the user principal name (UPN). For example: "someone@engineering.fabrikam.com" This element is the same as DS_CANONICAL_NAME except that the rightmost forward slash (/) is replaced with a newline character (\n), even in a domain-only case. For example: "engineering.fabrikam.com/software\nsomeone" Indicates it is using a generalized service principal name. For example: "www/www.fabrikam.com@fabrikam.com" Indicates a Security Identifier (SID) for the object. This can be either the current SID or a SID from the object SID history. The SID string can use either the standard string representation of a SID, or one of the string constants defined in Sddl.h. For more information about converting a binary SID into a SID string, see SID Strings. The following is an example of a SID string: "S-1-5-21-397955417-626881126-188441444-501" Class that provides methods against a AD domain service. Initializes a new instance of the class. Name of the domain controller. Name of the DNS domain. Converts a directory service object name from any format to the UPN. The name to convert. The corresponding UPN. Unable to resolve user name. Converts an array of directory service object names from one format to another. Name conversion enables client applications to map between the multiple names used to identify various directory service objects. The names to convert. Values used to determine how the name syntax will be cracked. Format of the input names. Desired format for the output names. An array of DS_NAME_RESULT_ITEM structures. Each element of this array represents a single converted name. Impersonation of a user. Allows to execute code under another user context. Please note that the account that instantiates the Impersonator class needs to have the 'Act as part of operating system' privilege set. Constructor. Starts the impersonation with the given credentials. Please note that the account that instantiates the Impersonator class needs to have the 'Act as part of operating system' privilege set. The name of the user to act as. The domain name of the user to act as. The password of the user to act as. Indicates that the value of the marked element could be null sometimes, so the check for null is necessary before its usage. [CanBeNull] object Test() => null; void UseTest() { var p = Test(); var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' } Indicates that the value of the marked element could never be null. [NotNull] object Foo() { return null; // Warning: Possible 'null' assignment } Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task and Lazy classes to indicate that the value of a collection item, of the Task.Result property or of the Lazy.Value property can never be null. Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task and Lazy classes to indicate that the value of a collection item, of the Task.Result property or of the Lazy.Value property can be null. Indicates that the marked method builds string by format pattern and (optional) arguments. Parameter, which contains format string, should be given in constructor. The format string should be in -like form. [StringFormatMethod("message")] void ShowError(string message, params object[] args) { /* do something */ } void Foo() { ShowError("Failed: {0}"); // Warning: Non-existing argument in format string } Specifies which parameter of an annotated method should be treated as format-string For a parameter that is expected to be one of the limited set of values. Specify fields of which type should be used as values for this parameter. Indicates that the function argument should be string literal and match one of the parameters of the caller function. For example, ReSharper annotates the parameter of . void Foo(string param) { if (param == null) throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol } Indicates that the method is contained in a type that implements System.ComponentModel.INotifyPropertyChanged interface and this method is used to notify that some property value changed. The method should be non-static and conform to one of the supported signatures: NotifyChanged(string) NotifyChanged(params string[]) NotifyChanged{T}(Expression{Func{T}}) NotifyChanged{T,U}(Expression{Func{T,U}}) SetProperty{T}(ref T, T, string) public class Foo : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; [NotifyPropertyChangedInvocator] protected virtual void NotifyChanged(string propertyName) { ... } string _name; public string Name { get { return _name; } set { _name = value; NotifyChanged("LastName"); /* Warning */ } } } Examples of generated notifications: NotifyChanged("Property") NotifyChanged(() => Property) NotifyChanged((VM x) => x.Property) SetProperty(ref myField, value, "Property") Describes dependency between method input and output.

Function Definition Table syntax:

FDT ::= FDTRow [;FDTRow]* FDTRow ::= Input => Output | Output <= Input Input ::= ParameterName: Value [, Input]* Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} Value ::= true | false | null | notnull | canbenull If method has single input parameter, it's name could be omitted.
Using halt (or void/nothing, which is the same) for method output means that the methos doesn't return normally (throws or terminates the process).
Value canbenull is only applicable for output parameters.
You can use multiple [ContractAnnotation] for each FDT row, or use single attribute with rows separated by semicolon. There is no notion of order rows, all rows are checked for applicability and applied per each program state tracked by R# analysis.
[ContractAnnotation("=> halt")] public void TerminationMethod() [ContractAnnotation("halt <= condition: false")] public void Assert(bool condition, string text) // regular assertion method [ContractAnnotation("s:null => true")] public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() // A method that returns null if the parameter is null, // and not null if the parameter is not null [ContractAnnotation("null => null; notnull => notnull")] public object Transform(object data) [ContractAnnotation("=> true, result: notnull; => false, result: null")] public bool TryParse(string s, out Person result)
Indicates that marked element should be localized or not. [LocalizationRequiredAttribute(true)] class Foo { string str = "my string"; // Warning: Localizable string } Indicates that the value of the marked type (or its derivatives) cannot be compared using '==' or '!=' operators and Equals() should be used instead. However, using '==' or '!=' for comparison with null is always permitted. [CannotApplyEqualityOperator] class NoEquality { } class UsesNoEquality { void Test() { var ca1 = new NoEquality(); var ca2 = new NoEquality(); if (ca1 != null) { // OK bool condition = ca1 == ca2; // Warning } } } When applied to a target attribute, specifies a requirement for any type marked with the target attribute to implement or inherit specific type or types. [BaseTypeRequired(typeof(IComponent)] // Specify requirement class ComponentAttribute : Attribute { } [Component] // ComponentAttribute requires implementing IComponent interface class MyComponent : IComponent { } Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), so this symbol will not be marked as unused (as well as by other usage inspections). Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes as unused (as well as by other usage inspections) Only entity marked with attribute considered used. Indicates implicit assignment to a member. Indicates implicit instantiation of a type with fixed constructor signature. That means any unused constructor parameters won't be reported as such. Indicates implicit instantiation of a type. Specify what is considered used implicitly when marked with or . Members of entity marked with attribute are considered used. Entity marked with attribute and all its members considered used. This attribute is intended to mark publicly available API which should not be removed and so is treated as used. Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. If the parameter is a delegate, indicates that delegate is executed while the method is executed. If the parameter is an enumerable, indicates that it is enumerated while the method is executed. Indicates that a method does not make any observable state changes. The same as System.Diagnostics.Contracts.PureAttribute. [Pure] int Multiply(int x, int y) => x * y; void M() { Multiply(123, 42); // Waring: Return value of pure method is not used } Indicates that the return value of method invocation must be used. Indicates the type member or parameter of some type, that should be used instead of all other ways to get the value that type. This annotation is useful when you have some "context" value evaluated and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one. class Foo { [ProvidesContext] IBarService _barService = ...; void ProcessNode(INode node) { DoSomething(node, node.GetGlobalServices().Bar); // ^ Warning: use value of '_barService' field } } Indicates that a parameter is a path to a file or a folder within a web project. Path can be relative or absolute, starting from web root (~). An extension method marked with this attribute is processed by ReSharper code completion as a 'Source Template'. When extension method is completed over some expression, it's source code is automatically expanded like a template at call site. Template method body can contain valid source code and/or special comments starting with '$'. Text inside these comments is added as source code when the template is applied. Template parameters can be used either as additional method parameters or as identifiers wrapped in two '$' signs. Use the attribute to specify macros for parameters. In this example, the 'forEach' method is a source template available over all values of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block: [SourceTemplate] public static void forEach<T>(this IEnumerable<T> xs) { foreach (var x in xs) { //$ $END$ } } Allows specifying a macro for a parameter of a source template. You can apply the attribute on the whole method or on any of its additional parameters. The macro expression is defined in the property. When applied on a method, the target template parameter is defined in the property. To apply the macro silently for the parameter, set the property value = -1. Applying the attribute on a source template method: [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")] public static void forEach<T>(this IEnumerable<T> collection) { foreach (var item in collection) { //$ $END$ } } Applying the attribute on a template method parameter: [SourceTemplate] public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) { /*$ var $x$Id = "$newguid$" + x.ToString(); x.DoSomething($x$Id); */ } Allows specifying a macro that will be executed for a source template parameter when the template is expanded. Allows specifying which occurrence of the target parameter becomes editable when the template is deployed. If the target parameter is used several times in the template, only one occurrence becomes editable; other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence, use values >= 0. To make the parameter non-editable when the template is expanded, use -1. > Identifies the target parameter of a source template if the is applied on a template method. ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC action. If applied to a method, the MVC action name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String). ASP.NET MVC attribute. Indicates that a parameter is an MVC area. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String). ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC controller. If applied to a method, the MVC controller name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String). ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute for custom wrappers similar to System.Web.Mvc.Controller.View(String, String). ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute for custom wrappers similar to System.Web.Mvc.Controller.View(String, Object). ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC partial view. If applied to a method, the MVC partial view name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String). ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method. ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String). ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String). ASP.NET MVC attribute. Indicates that a parameter is an MVC template. Use this attribute for custom wrappers similar to System.ComponentModel.DataAnnotations.UIHintAttribute(System.String). ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view component. If applied to a method, the MVC view name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Controller.View(Object). ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view component name. ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view component view. If applied to a method, the MVC view component view name is default. ASP.NET MVC attribute. When applied to a parameter of an attribute, indicates that this parameter is an MVC action name. [ActionName("Foo")] public ActionResult Login(string returnUrl) { ViewBag.ReturnUrl = Url.Action("Foo"); // OK return RedirectToAction("Bar"); // Error: Cannot resolve action } Razor attribute. Indicates that a parameter or a method is a Razor section. Use this attribute for custom wrappers similar to System.Web.WebPages.WebPageBase.RenderSection(String). Indicates how method, constructor invocation or property access over collection type affects content of the collection. Method does not use or modify content of the collection. Method only reads content of the collection but does not modify it. Method can change content of the collection but does not add new elements. Method can add new elements to the collection. Indicates that the marked method is assertion method, i.e. it halts control flow if one of the conditions is satisfied. To set the condition, mark one of the parameters with attribute. Indicates the condition parameter of the assertion method. The method itself should be marked by attribute. The mandatory argument of the attribute is the assertion type. Specifies assertion type. If the assertion method argument satisfies the condition, then the execution continues. Otherwise, execution is assumed to be halted. Marked parameter should be evaluated to true. Marked parameter should be evaluated to false. Marked parameter should be evaluated to null value. Marked parameter should be evaluated to not null value. Indicates that the marked method unconditionally terminates control flow execution. For example, it could unconditionally throw exception. Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select, .Where). This annotation allows inference of [InstantHandle] annotation for parameters of delegate type by analyzing LINQ method chains. Indicates that IEnumerable, passed as parameter, is not enumerated. Indicates that parameter is regular expression pattern. Prevents the Member Reordering feature from tossing members of the marked class. The attribute must be mentioned in your member reordering patterns XAML attribute. Indicates the type that has ItemsSource property and should be treated as ItemsControl-derived type, to enable inner items DataContext type resolve. XAML attribute. Indicates the property of some BindingBase-derived type, that is used to bind some item of ItemsControl-derived type. This annotation will enable the DataContext type resolve for XAML bindings for such properties. Property should have the tree ancestor of the ItemsControl type or marked with the attribute. Extensions for classes in the System.Security.AccessControl namespace. Canonicalizes the specified Access Control List. The Access Control List. Sort ACEs according to canonical form for this . The object security whose DiscretionaryAcl will be made canonical. Returns an array of byte values that represents the information contained in this object. The object. The byte array into which the contents of the is marshaled. Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object or returns the value of . If is undefined, it returns the first declared item in the enumerated type. The enumeration type to which to convert . The string representation of the enumeration name or underlying value to convert. true to ignore case; false to consider case. The default value. An object of type whose value is represented by value. Converts an that points to a C-style array into a CLI array. Type of native structure used by the C-style array. Output type for the CLI array. must be able to convert to . The pointing to the native array. The number of items in the native array. An array of type containing the converted elements of the native array. Converts an that points to a C-style array into a CLI array. Type of native structure used by the C-style array. The pointing to the native array. The number of items in the native array. An array of type containing the elements of the native array. Extensions related to System.Reflection Loads a type from a named assembly. Name of the type. The name or path of the file that contains the manifest of the assembly. The reference, or null if type or assembly not found. Tries the retrieve a reference from an assembly. Name of the type. The assembly reference name from which to load the type. The reference, if found. true if the type was found in the assembly; otherwise, false. Tries the retrieve a reference from an assembly. Name of the type. The assembly from which to load the type. The reference, if found. true if the type was found in the assembly; otherwise, false. Invokes a named method on a created instance of a type with parameters. The expected type of the method's return value. The type to be instantiated and then used to invoke the method. This method assumes the type has a default public constructor. Name of the method. The arguments to provide to the method invocation. The value returned from the method. Invokes a named method on a created instance of a type with parameters. The expected type of the method's return value. The type to be instantiated and then used to invoke the method. The arguments to supply to the constructor. Name of the method. The arguments to provide to the method invocation. The value returned from the method. Invokes a named method on an object with parameters and no return value. The object on which to invoke the method. Name of the method. The arguments to provide to the method invocation. Invokes a named method on an object with parameters and no return value. The expected type of the method's return value. The object on which to invoke the method. Name of the method. The types of the . The arguments to provide to the method invocation. The value returned from the method. Gets a named property value from an object. The expected type of the property to be returned. The object from which to retrieve the property. Name of the property. The default value to return in the instance that the property is not found. The property value, if found, or the if not. Sets a named property on an object. The type of the property to be set. The object on which to set the property. Name of the property. The property value to set on the object.