NtBackup Part:2 schedueling a task via cmd.

As part of an ntbackup script i began recently, I needed to look at how to schedule tasks from remotely. I had some experience using at.exe but seeing as schtasks seems to be the new tool i decided to give it a lash.

Almost immediately i ran into problems, if i was to specify a username and password for the job to run as, the script demanded a system name… why ask for a system name if you want to run it locally i wondered, but with using the %computername% variable it allowed me to run this locally.

schtasks /create /s %computername% /u domainusername /p Password /tn Server-Backup /tr “c:backup.bat” /sc daily /st 09:00:00

the above schedules backup.bat to run as whatever user you specify, it will display as “Server-Backup” in scheduled tasks and will run daily for ever.

Below is an example of what you should see in scheduled tasks:

Check the next post for information on how to roll this out to multiple servers.

Related Posts

Enabling disk caches from a script Just a quick post to share a fundamental performance increase to any citrix server out there running on local disk. If your disk supports caching, ena...
Forcing a printer online using a script: Recently while installing Zetafax 11, we noticed that some of our maintenance scripts on our XenApp servers were causing the zetafax printer to fall o...
Igel Database command mistake. Despite Igels better judgement, the command they have published in their documentation to create an SQL database does not work. The command itself can...

Leave a Reply