scripting schtasks
- From: arno <rnospam_AT_xs4all_DOT_nl>
- Date: Tue, 10 Feb 2009 18:48:48 +0100
Hi,
Need some advice please. My problem in short:
How can I script a task to run under user/other credentials without
user intervention and without exposing the password through the
script?
In more detail:
I have a logon script that creates a Scheduled Task, once, at a random
time. The task itself consists of running a standalone vbs (let's call
it MyScript.vbs) file to be executed. MyScript.vbs itself works fine,
it compares and copies some files from a network server to the local
machine.
The task is created without problem, code goes something like this
(example is bogus code, but it works, this is not the problem)
oWSH.Run "schtasks.exe /create /tn MyTask /sc ONCE /st SomeTime /sd
SomeDate /tr x:\path\MyScript.vbs /ru SYSTEM"
The problem is that while the task is created fine, and upon further
inspection in the Task Scheduler looks fine to me, it does not get
executed. It will simply error saying "Could not start".
When I create this task using my own credentials, it will run fine. If
I create it to run as System, it will fail. So there's the error. I
need to somehow pass the users or other credentials to the task to be
created, but I would like not to expose the password in the logon
script that creates the task.
Any suggestions greatly appreciated,
tia,
arno
.
- Follow-Ups:
- Re: scripting schtasks
- From: Al Dunbar
- Re: scripting schtasks
- Prev by Date: Re: Security Groups from VPN
- Next by Date: Re: Office document protection
- Previous by thread: Security issues when running login script.
- Next by thread: Re: scripting schtasks
- Index(es):
Relevant Pages
|