Windows VPSWindows VPS

Create Scheduled Tasks on Windows Server

Guide to automating a Windows Server VPS at Lordhosting with scheduled tasks: Task Scheduler, PowerShell, backup, restart and cleanup scripts, and reading the run history.

On a Windows Server VPS, scheduled tasks automate everything that must run without you: nightly backups, restarting a service, cleaning up logs. It is the equivalent of cron on Linux. This guide covers creation through the interface and through PowerShell, with ready-to-use scripts.

⚙️ Requirements

  • A Lordhosting VPS running Windows Server with administrator RDP access
  • Ideally, IIS installed if you are automating a web server

⚙️ 1. Open Task Scheduler

Press Win + R, type taskschd.msc and confirm. The Task Scheduler Library lists all existing tasks.

⚙️ 2. Create a simple task (interface)

In the right pane, click Create Basic Task, then follow the wizard:

  1. Name: give a clear name (e.g. "Daily Backup").
  2. Trigger: choose the frequency (daily, at logon, on event…).
  3. Action: "Start a program".
  4. Program/script: the path to your executable or script.
Run without an open session

Open the task properties, General tab, and tick "Run whether user is logged on or not". Essential for a task that must run at night.

⚙️ 3. Manage tasks in PowerShell

Faster and scriptable. Create a task that runs a script every night at 3 a.m.:

$action  = New-ScheduledTaskAction -Execute "powershell.exe" `
  -Argument "-ExecutionPolicy Bypass -File C:\scripts\backup.ps1"
$trigger = New-ScheduledTaskTrigger -Daily -At 3am
Register-ScheduledTask -TaskName "Daily Backup" -Action $action -Trigger $trigger `
  -User "SYSTEM" -RunLevel Highest

Manage existing tasks:

Get-ScheduledTask                       # list tasks
Start-ScheduledTask -TaskName "Daily Backup"   # run now
Unregister-ScheduledTask -TaskName "Daily Backup" -Confirm:$false  # delete

⚙️ 4. Useful scripts

A compressed backup of a folder:

$date = Get-Date -Format "yyyy-MM-dd"
Compress-Archive -Path "C:\inetpub\mysite" -DestinationPath "D:\backups\site-$date.zip" -Force

Restart a crashed service:

Restart-Service -Name "W3SVC"   # the IIS service

Clean up old log files (older than 30 days):

Get-ChildItem "C:\logs" -Recurse -File |
  Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } |
  Remove-Item -Force

⚙️ 5. Read the run history

In Task Scheduler, select your task then the History tab: every run appears with its return code. Enable history via "Enable All Tasks History" in the right pane if it is empty.

✅ Conclusion

You now know how to automate your Windows VPS: backups, restarts and cleanups run on their own, at night, and you check them in the history. Combine these tasks with an IIS web server for fully automated administration.

Need a reliable Windows server? Our Windows VPS are delivered in minutes with RDP included and full administrator access.


❗Always good to know

  • If a task won't run or returns an error, our support is here: open a ticket or drop by Discord.

Frequently asked questions

Back to Windows VPS
Was this article helpful?
Welcome Offer

Sign up now and enjoy 10% off on your first order by entering the promo code: WELCOME

Logo LordHostingLordhosting is a SASU with a share capital of €1,000. SIREN 105 383 988 RCS Paris.
Copyright © 2026 LordHosting.