BaseBuilderAsTask(String, TaskCreation, String, String, TaskLogonType) Method
Assigns the name of the task and registers it.
Namespace: Microsoft.Win32.TaskScheduler.FluentAssembly: 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
)
- 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.
TaskA registered
Task instance.