 | 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
Syntaxpublic Task AsTask(
string name,
TaskCreation createType,
string userId,
string password = null,
TaskLogonType logonType = TaskLogonType.S4U
)
Public Function AsTask (
name As String,
createType As TaskCreation,
userId As String,
Optional password As String = Nothing,
Optional logonType As TaskLogonType = TaskLogonType.S4U
) As Task
public:
Task^ AsTask(
String^ name,
TaskCreation createType,
String^ userId,
String^ password = nullptr,
TaskLogonType logonType = TaskLogonType::S4U
)
Request Example
View SourceParameters
- 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:
TaskA registered
Task instance.
See Also