S
Senapathy
Hello all,
Environment: W2K SP3, VC6
I create a scheduled task in W2K using the ITaskScheduler, ITask interfaces.
1) ITaskScheduler::NewWorkitem
2) ITask::CreateTrigger
3) ITask::SetAccountInformation
4) IPersistFile::Save
The code that I use for setting the account information is the following:
if(strUser.IsEmpty())
{
hr = pTask->SetAccountInformation(L"", NULL);
}
else
{
hr = pTask->SetAccountInformation(strUser, strPwd);
}
- If I pass a non-empty user name password combination to set the account
information, the task runs properly.
- If I pass the the account information as L"" - in order to run under
system account - it creates the task, but the task does not run.
I can see in the scheduled task system log the following error:
" The attempt to log on to the account associated with the task failed,
therefore, the task did not run.
The specific error is:
0x8007054b: The specified domain either does not exist or could not be
contacted.
Verify that the task's Run-as name and password are valid and try again."
Can anyone tell me how to run a task under the system account?
Senapathy
Environment: W2K SP3, VC6
I create a scheduled task in W2K using the ITaskScheduler, ITask interfaces.
1) ITaskScheduler::NewWorkitem
2) ITask::CreateTrigger
3) ITask::SetAccountInformation
4) IPersistFile::Save
The code that I use for setting the account information is the following:
if(strUser.IsEmpty())
{
hr = pTask->SetAccountInformation(L"", NULL);
}
else
{
hr = pTask->SetAccountInformation(strUser, strPwd);
}
- If I pass a non-empty user name password combination to set the account
information, the task runs properly.
- If I pass the the account information as L"" - in order to run under
system account - it creates the task, but the task does not run.
I can see in the scheduled task system log the following error:
" The attempt to log on to the account associated with the task failed,
therefore, the task did not run.
The specific error is:
0x8007054b: The specified domain either does not exist or could not be
contacted.
Verify that the task's Run-as name and password are valid and try again."
Can anyone tell me how to run a task under the system account?
Senapathy