Scheduling a task without password

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
jkeck
Posts: 2
Joined: Sat Mar 27, 2004 5:48 pm

Scheduling a task without password

Post by jkeck »

I need to schedule a task for a user. I know what their username is, but I don't know what their password is. Is there a way I can schedule a task without this piece of information? I have not been able to figure it out. I am currently using the trial version of this product, and I will be buying it if I can get this to work!
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

If user has password then task should has it as well in order to run. But it is not possible to detect the user password. So you may try to configure tasks to be executed without account information. So just set account and password to empty values and then it should be possible to execute task.
Hope this helps.
jkeck
Posts: 2
Joined: Sat Mar 27, 2004 5:48 pm

Post by jkeck »

Hello, thank you for your prompt response. When I set account and password to empty values, the scheduled task is not able to run. Is there something I am missing? I am using Win XP.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

It is highly recommended to use non-empty account name and password as only
in this case a task runs under existing account, allows user input, and has
access rights corresponding to its account. However, it is possible to
schedule a task with empty account and password. This task would run under
SYSTEM account. Note, in order to schedule such a task you must run your
application under Administrator account! Another important point is if you
set blank account/password your task must be scheduled WITHOUT the flag
tfRunOnlyIfLoggedOn. So the setting account information might look as
follows:

Code: Select all

...
if (Trim(wsAccount) = EmptyStr) and (Trim(wsPassword) = EmptyStr) then
  FTask.Flags := FTask.Flags - [tfRunOnlyIfLoggedOn]
else
  FTask.Flags := FTask.Flags + [tfRunOnlyIfLoggedOn];
FTask.SetAccountInformation(wsAccount, wsPassword);
...
Post Reply