The SASetAccountInformation method MUST set the credentials under which the task MUST run.

 HRESULT SASetAccountInformation(
   [in, string, unique] SASEC_HANDLE Handle,
   [in, string] const wchar_t* pwszJobName,
   [in, string] const wchar_t* pwszAccount,
   [in, string, unique] const wchar_t* pwszPassword,
   [in] DWORD dwJobFlags
 );

Handle: Pointer to a Unicode string that MUST specify the server. The client MUST map this string to an RPC binding handle. The server MUST ignore this parameter. For more information, see [C706] sections 4.3.5 and 5.1.5.2.

pwszJobName: Pointer to a string that MUST specify a task name, such as "MyJob.job".

pwszAccount: Pointer to a string that MUST specify the account name. This string MAY be expressed either as a UPN in the form user@domain or as a Security Account Manager (SAM) name in the form domain\account.

pwszPassword: Pointer to a string that MUST specify the password for the account. See section 5.1.

dwJobFlags: The dwJobFlags field MUST contain individual bit flags that MUST have one or more of the following values:


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

R L

0

0

0

0

0

0

0

0

0

0

0

0

0

Value

Description

RL

TASK_FLAG_RUN_ONLY_IF_LOGGED_ON

When set, the task MUST run only if the user specified is logged on interactively.

Undefined bits MUST be set to 0 when sent and ignored upon receipt.

Return Values: For more information about return codes, see section 2.3.14 or Win32 Error Codes in [MS-ERREF] section 2.1.<52>

Upon receipt of the SASetAccountInformation call, the server MUST: