scripting schtasks

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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





.



Relevant Pages

  • RE: synchronizing domain user Local cached credentials with domain
    ... Would you mind emailing me your script? ... windows taskbar bubble which would indicate that their password needs to be ... locally cached credentials are out of sync with domain credentials. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Wired error of get-credential for non-privilege user
    ... When we pass that to the Process.Start method, it has intermittent difficulty dealing with that form of a username. ... and try you script again, If I use the GUI I have the same effect. ... > Did you fill the credentials? ... >> Cmdlet get-credential at command pipeline position 1 ...
    (microsoft.public.windows.server.scripting)
  • Release: Pass-The-Hash toolkit v1.3
    ... This .IDC IDA Pro script can be used to obtain the addresses ... iam and whosthere need to obtain/modify logon session credentials. ... addresses you need to add to the source code to add support for the ...
    (Pen-Test)
  • Re: need to modify local group membership via VBscript
    ... A logon script runs with the credentials of the user, ... ' Bind to local Administrators group on remote computer. ... Wscript.Echo "Domain Admins already in Administrators on " & strComputer ...
    (microsoft.public.windows.server.scripting)
  • [Full-disclosure] Release: Pass-The-Hash toolkit v1.3
    ... This .IDC IDA Pro script can be used to obtain the addresses ... iam and whosthere need to obtain/modify logon session credentials. ... addresses you need to add to the source code to add support for the ...
    (Full-Disclosure)