Is there a way to import a scheduled task from windows 2003 (.job) to windows 2008 (.xml)?
Looks like they were discussing the problem here: http://social.technet.microsoft.com/Forums/en-US/itprovistamigration/thread/76b6276b-49f2-41e2-b4ea-f537e0eb88a8
Seems like there is no current approved method of doing this.
However one user in that forum posted this:
If you run schtasks from the vista/2008 server maching you can export the xp/2003 schtasks to xml. schtasks /query /s xpmachine /tn taskname /XML > taskname.xml then you can import it. not perfect but can save time. i exported the tasks using /fo table opened that to excel deleted unneeded columns and created a batch file to dump the xmls then /create /xml xmlfile.xml to import the xmls to the new server. hope this helps.
So it seems possible but it needs some jiggery pokery.
I tried it out myself but kept on getting access denied errors from Win2008. Even though I was the network admin with all privileges. Maybe someone else could make an attempt?
EDIT-Solution:
Where you got your job files was probably c:\windows\tasks, however under Vista there is a new place the xml files exist. (Under c:\windows\system32\tasks) Try looking there on your old machine if possible.
HOWEVER, there is a way if you can't get to the original machine easily.
- You will need 2 files off an XP machine (Schtasks.exe and Schedsvc.dll) they are both in the Windows\System32 folder, copy them to USB and thats all you need from XP.
- Now on your Vista machine. Put them in their own directory on your vista machine (lets say you make a directory called c:\sch and put those 2 files in there) DO NOT overwrite the vista ones in c:\windows\system32.
- Rename your job files Test1.job, Test2.job, Test3.job, Test4.job and copy them into c:\windows\tasks
- Open up a command prompt (Start Programs, Accessories, right click on Command Prompt and select run as administrator)
- Now to touch over the new .job files to get vistas scheduler to take on the parameters.
- In your command prompt
type in cd c:\sch then enter (for our example)- Now for each job type in schtasks /change /TN "Test1" /RU Terry /RP Terry (Changing the Test1 to Test2, Test3, Test4 for our example) The /RP and /RU values will have to change, thats a username and password (RP being password, RU Being User)
- You should receive the message SUCCESS: The parameters of scheduled task "Test1" have been changed. for each job.
When done close your command prompt. From there Windows scheduler now knows about these, and you can use the windows Gui to update their names, and who they run as.
I have tried this personally and yes it does work. It would only take a little more effort to script it. You just need to leave the xp files on the vista machine. You could then export them as XML via script as well.
Link: From experts exchange
I found another way that was even easier, for me; it requires more clicking, but less actual thinking. You have to be able to "connect" to your old Windows Server 2003 machine from a Windows Server 2008 machine.
On the Win2k8 box, open the Task Scheduler (from the "Administrative Tools" menu, not Server Manager). Click on the "Task Scheduler (Local)" node, then in the Actions, you can choose "Connect to another Computer"; connect to your Win2k3 machine.
Now, when you click on the "Task Scheduler Library", you'll see all of your Win2k3 tasks. At this point you can right-click on the task you want and choose "Export...". You now have an .xml file that you can directly import into a Win2k8 Task Scheduler!
Although the above answers that describe the manual process worked for me as well, I wanted an easier way to do it and came up with this: http://briandunnington.github.io/migrate-scheduled-jobs.html
Essentially, you copy your .job files to c:\windows\tasks, then run the script (providing a username/password) and your jobs are automatically converted - no messing with copying old dlls or renaming things, etc.