BaseBuilderAsTask(String, TaskCreation, String, String, TaskLogonType) Method

Assigns the name of the task and registers it.

Definition

Namespace: Microsoft.Win32.TaskScheduler.Fluent
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.1
public Task AsTask(
	string name,
	TaskCreation createType,
	string userId,
	string password = null,
	TaskLogonType logonType = TaskLogonType.S4U
)

Parameters

name  String
The name.
createType  TaskCreation
A union of TaskCreation flags.
userId  String
The user credentials used to register the task.
password  String  (Optional)
The password for the userId used to register the task.
logonType  TaskLogonType  (Optional)
A TaskLogonType value that defines what logon technique is used to run the registered task.

Return Value

Task
A registered Task instance.

See Also