Scheduling a task without password
Scheduling a task without password
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!
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.
Hope this helps.
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:
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);
...