Migrate scheduled tasks from 2003 to 2008

Well, the time has come for me to learn at last syntax for schtasks what I was reluctant to do. Some time you have to migrate a task or a bunch of them from one computer to another. In my case it was even more “interesting” task: migrate some tasks from Windows Server 2003 box to Windows 2008 R2. If you have only one it is no problem to move it manually, but what if there are many of them? Here it is: the moment of schtasks’ triumph! =)

What it can do for us is to export 2003’s tasks into an XML file. Suppose we have task “Command Prompt” which launches cmd.exe once:

image

image

image

Now let’s use our secret weapon (run it from 2008 box):

image

In Task.xml we now have the following content:

   1: <?xml version="1.0" encoding="utf-16"?>

   2: <Task version="1.1" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">

   3:   <RegistrationInfo>

   4:     <Author>trofimov</Author>

   5:   </RegistrationInfo>

   6:   <Triggers>

   7:     <TimeTrigger>

   8:       <Enabled>true</Enabled>

   9:       <StartBoundary>2011-04-10T23:43:00</StartBoundary>

  10:     </TimeTrigger>

  11:   </Triggers>

  12:   <Settings>

  13:     <Enabled>true</Enabled>

  14:     <DeleteExpiredTaskAfter>PT0S</DeleteExpiredTaskAfter>

  15:     <ExecutionTimeLimit>PT259200S</ExecutionTimeLimit>

  16:     <Hidden>false</Hidden>

  17:     <WakeToRun>false</WakeToRun>

  18:     <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>

  19:     <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>

  20:     <RunOnlyIfIdle>false</RunOnlyIfIdle>

  21:     <Priority>5</Priority>

  22:     <IdleSettings>

  23:       <Duration>PT600S</Duration>

  24:       <WaitTimeout>PT3600S</WaitTimeout>

  25:       <StopOnIdleEnd>false</StopOnIdleEnd>

  26:       <RestartOnIdle>false</RestartOnIdle>

  27:     </IdleSettings>

  28:   </Settings>

  29:   <Principals>

  30:     <Principal>

  31:       <UserId>System</UserId>

  32:     </Principal>

  33:   </Principals>

  34:   <Actions>

  35:     <Exec>

  36:       <Command>C:WINDOWSsystem32cmd.exe</Command>

  37:       <WorkingDirectory>C:WINDOWSsystem32</WorkingDirectory>

  38:     </Exec>

  39:   </Actions>

  40: </Task>

which we can now import to our W2008R2 box with schtasks or even through GUI:

image

image

image

Of course, doing that with schtasks is more efficient way to import more than one task, but GUI is much more spectacular 😉

Advertisements

10 thoughts on “Migrate scheduled tasks from 2003 to 2008

  1. Alexander Trofimov Post author

    Jeez… That’s how good people are compromised!!! )
    thanks for noting, next time I’ll be more conscious =)

    Reply
  2. Indrakumar

    Hi,

    I tried have exported all the task in 2003 server and while importbg am getting error.

    The formant of the tasl is not valid. The following error was reported:
    (2,3): Tasks:

    Reply
  3. Edong

    Hi,
    I have windows server 2003 and window 7.
    i tried to export all of Scheduled task of server 2003 using Window 7.
    but i encoutered error: Access is denied

    Reply
  4. Shrimant Patel

    Step by Step easiest solution:
    1. Open Task Scheduler(TS) in Windows 2008 or 2012
    2.Select top node on the left pane named “Task Scheduler(Local)”
    3. Click on “ACTION” Menu on the top , and select “Connect to Another Computer..”, Ken in the IP address or the name of your 2003 server and click OK.
    4.Click on the 2nd Node on the left pane named “Task Scheduler Library”, you might get a message box with info “Copyconfig.job” no longer exists…just ignore it and click OK, you should see all your 2003 server scheduled jobs on the right pane.
    5.Select the 2003 tasks one at a time , then right click and select export…export it to a known location.
    6. Once you are done exporting all the 2003 tasks, close the Task Scheduler and reopen it.
    7.Click on the ACTION menu, select Import and import from the exported location One Job at a time , make sure to user account under whom the jobs needs to be run in the new server.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s