Re: Exporting / Altering scheduled tasks

From: Dave Patrick (mail_at_NoSpam.DSPatrick.com)
Date: 06/08/04


Date: Tue, 8 Jun 2004 16:36:26 -0600

One idea might be to run from the command line;
schtasks /query >D:\dave.txt
then import the text file into excel and loop through the 'TaskName' column
and run against each of the tasks

schtasks /change /ru <newuser> /rp <newpassword> /tn <taskname>

D:\>schtasks /change /?

SCHTASKS /Change [/S system [/U username [/P password]]] {[/RU runasuser]
    [/RP runaspassword] [/TR taskrun]} /TN taskname

Description:
    Changes the program to run, or user account and password used by a
scheduled task.

Parameter List:
    /S system Specifies the remote system to connect to.

    /U username Specifies the user context under which the
command should execute.

    /P password Specifies the password for the given user
context.

    /RU username Changes the user name (user context) under
which the scheduled task has to run.
                              For the system account, valid values are "",
"NT AUTHORITY\SYSTEM" or "SYSTEM".

    /RP password Specifies a new password for the existing user
context or the password for a new user account. Password will not effect for
the system account.

    /TR taskrun Specifies a new program that the scheduled
task runs. Type the path and file name of the program.

    /TN taskname Specifies which scheduled task to change.

    /? Displays this help/usage.

Examples:
    SCHTASKS /Change /RP password /TN "Backup and Restore"
    SCHTASKS /Change /TR restore.exe /TN "Start Restore"
    SCHTASKS /Change /S system /U user /P password /RU newuser
             /TN "Start Backup"

-- 
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"Benny" wrote:
| Hi All
|
| I have a client who has about 2000 jobs running nightly reports in 
Schedules
| Tasks on Win2000 Pro. He needs to move them to his new win2003 server. But
| when he moves them (via copy/paste) each job need various things amending
| before it will run. ie, user/password credentials, file paths, etc
| Obviously he does not want to have to edit each of the 2000 jobs, so does
| any one know if there is a tool out there to automate changes to multiple
| schedule tasks like this? Or alternatively does any one know of any 3rd
| party scheduling tools that may be easier to do these sort of things ?
|
| Any suggestions much appreciated.
|
| Ben
|
| 


Relevant Pages

  • Re: Exporting / Altering scheduled tasks
    ... One idea might be to run from the command line; ... which the scheduled task has to run. ... context or the password for a new user account. ...
    (microsoft.public.windowsxp.general)
  • Re: Export data on scheduled basis when no user in database?
    ... up the scheduled task to run that file. ... you mentioned not being able to enter a command line for Scheduled Tasks. ... I've never used Klatuu's idea of Task Scheduler for Access. ... Make or modify a macro named AUTOEXEC that opens frmTimer. ...
    (microsoft.public.access.externaldata)
  • Re: Deleting Scheduled Tasks across the Enterprise using SMS 2003
    ... however command prompt remains open. ... > have to install anything on a workstation whereas with a MSI you still> are ... >>> We no longer need this because we are migrating to SMS 2003. ... >>> uninstall however it did not delete the scheduled task. ...
    (microsoft.public.sms.admin)
  • Re: Scheduling tasks through command line.
    ... MS-MVP Windows Shell/User ... To achieve this programatically I try to run the following command from ... Using this command I am able to create a scheduled task on the remote ... but I observed that the scheduled task is not being executed. ...
    (microsoft.public.windowsxp.basics)
  • Re: grrr... how do i get 150+ systems to reboot at 3AM every night through a GPO?
    ... Otherwise you could preface it with the following command: ... Simplify Group Policy Troubleshooting with the NEW GPExpert ... Use the shutdown.exe from MS and configure a scheduled task on your machine. ...
    (microsoft.public.windows.group_policy)