Windows 08 R2 Backup : create task template
There are no native cmdlets to allow you manage Scheduled tasks on windows machine, however you can use powershell as a wrapper to the schtasks.exe command. Funnily enough I am running my wrapper script as I type this...
sctasks.exe will do all sorts of things - add, delete, modify, view scheduled tasks - I won't go into it here, there plenty of info out there :) just modify the command appropriately.
example code:
$listofServers = get-content "MyServers.txt"
foreach ($server in $listofServers) {
$output = schtasks.exe /query /fo CSV /v /s $server
write-output $output
}
edit I forgot to add that then you can have a CSV or JOB file etc you can use as your template, and then use schtasks.exe to push it out to servers.
Related videos on Youtube
remunda
Updated on September 17, 2022Comments
-
remunda over 1 year
it is possible to create a backup template or somehow configure backup shedule besides regular daily backup to local disk. I want to backup whole system every sunday to shared network folder. I must do it manually with "Backup once" in Windows Server Backup Console.
I looked into task scheduler and daily backup task is executed with templateId, like this:
wbadmin.exe start backup -templateId:{b217544a-00d6-4358-a8dd-ee14b82574f7} -quiet
It is possible to create another template with another setting?
I'm using windows server 2008 r2 standart.
Thanks a lot!