Click or drag to resize
Task Scheduler Managed Class Library

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

Assigns the name of the task and registers it.

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

Parameters

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

Return Value

Type: Task
A registered Task instance.
See Also