TaskServiceFindAllTasks(PredicateTask, Boolean) Method

Finds all tasks matching a name or standard wildcards.

Definition

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.1
public Task[] FindAllTasks(
	Predicate<Task> filter,
	bool searchAllFolders = true
)

Parameters

filter  PredicateTask
The filter used to determine tasks to select.
searchAllFolders  Boolean  (Optional)
if set to true search all sub folders.

Return Value

Task
An array of Task containing all tasks matching filter.

Example

Returns all tasks with logon triggers
TaskService.Instance.FindAllTasks(t => t.Triggers.ContainsType(typeof(LogonTrigger)), true);

See Also