What and where to back up (quick checklist)
- Objects: volumes/files, System State (registry, boot loader, etc.), application data if available (e.g., MSSQL makes its own dumps).
- Destination: separate VPS disk, NAS/file server via SMB, cloud storage. For storage, only SYSTEM/administrators must have NTFS rights.
- Policy: daily — incremental/full (depending on the destination), weekly — full, retention period N versions (e.g., 14–30).
- Readiness criteria: backup runs without errors, log is readable, test recovery is performed periodically.
Installing the Windows Server Backup (WSB) component
WSB is a built-in OS tool that can handle System State, volumes, files, and runs on a schedule.
Get-WindowsFeature Windows-Server-Backup
Add-WindowsFeature Windows-Server-Backup -IncludeAllSubFeature
Prepare the target folder and permissions
For network storage, create a separate directory, grant RW permissions only to SYSTEM, Domain Admins (or local administrators), and, if necessary, source computer objects.
Important: When backing up to a network folder, the standard wbadmin.msc utility saves only one “current” copy. For many versions, we use wbadmin.exe + our own rotation (see below).
wbadmin script: daily backup to folders with the date
Create a folder like \\backup-srv\winvps01$\YYYY-MM-DD and start the backup. For System State, use -systemState, for volumes — -include:C:,D:.
$Base=“\\backup-srv\winvps01$\# replace with your layer/disk
$Date=Get-Date -Format ”yyyy-MM-dd"
$Target=Join-Path $Base $Date
if (-not (Test-Path $Target)) { New-Item -ItemType Directory -Path $Target | Out-Null }
# Option A: System State
$cmd = “wbadmin start backup -backuptarget:$Target -systemState -noverify -vssCopy -quiet”
# Option B: specified volumes (+critical)
# $cmd = “wbadmin start backup -backuptarget:”+$Target+“ -include:C:,D: -allCritical -quiet”
Invoke-Expression $cmd
Scenario with a “by date” folder, running wbadmin, and log examples
Import-Module ServerManager
$string $date = get-date -f 'yyyy-MM-dd'
$path="\\\col\backup\dcl\"
$TargetUNC = "$path$date"
$TestTargetUNC = Test-Path -Path $TargetUNC
if (!($TestTargetUNC)) {
New-Item -Path $TargetUNC -ItemType directory
}
$WBadmin_cmd = "wbadmin.exe START BACKUP -backupTarget:$TargetUNC -systemState -noverify -vssCopy"
Invoke-Expression $WBadmin_cmd
Where to view logs: C:\Windows\Logs\WindowsServerBackup\*.log
On a locally connected disk, you can limit the number of versions by default:
wbadmin delete backup -keepVersions:10 -quiet
Scheduler: automatic script launch
Option via GUI
taskschd.msc → Create Task… → it is better to launch from SYSTEM + Run with highest privileges → configure triggers and action powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\PS\Backup.ps1.
Option via PowerShell
$Trigger=New-ScheduledTaskTrigger -Daily -At 1:00am
$Action =New-ScheduledTaskAction -Execute "PowerShell.exe" `
-Argument "-NoProfile -ExecutionPolicy Bypass -File C:\PS\Backup.ps1"
Register-ScheduledTask -TaskName "VPS-DailyBackup" -Trigger $Trigger `
-User "NT AUTHORITY\SYSTEM" -Action $Action -RunLevel Highest -Force
The all-in-one alternative:
wbadmin enable backup -addtarget:E: -schedule:01:00 -include:C:,D: -quiet
Creates a daily schedule using WSB. Syntax — in Microsoft Learn.
“Quick” versions for files: Robocopy (+ daily folders)
For the data catalog (sites, uploads), it is convenient to make folder snapshots by date:
@echo off
set date_=%date:/=-%
set src=D:\Data
set dst=\\backup-srv\winvps01$\%date_%
mkdir "%dst%"
robocopy "%src%" "%dst%" /E /COPYALL /Z /J /R:3 /W:1 /LOG+:C:\Logs\robocopy.log
Enable VSS snapshots (shadow copies) for “quick rollback”
Shadow copies provide “previous versions” and help you quickly restore individual files without a large backup. In a domain, it is convenient to enable VSS with policies and create snapshots with a script/scheduler.
Enable the Volume Shadow Copy service (startup type: Automatic).
Regularly create a snapshot (example with vshadow.exe) and reserve 10–20% of the disk for shadows.
List of snapshots: vssadmin list shadows → take the Shadow Copy ID.
Mount a specific snapshot (read-only) and copy the files:
vshadow -el={GUID},Z:
VSS and shadow volume base — in Microsoft Learn.
Check, monitor, rotate
- Recovery test: periodically mount VHDX/folder with the date and restore a couple of files “to the desktop.” For critical roles, use profile procedures (AD, MSSQL, etc.).
- Logs and return codes: WindowsServerBackup logs, return codes (mask) for Robocopy.
- Rotation: delete old folders by date (PowerShell) and/or wbadmin delete backup -keepVersions:N.
- Schedule wbadmin enable backup — settings and syntax in Microsoft Help.
Common problems and solutions
- It says that only one copy is stored on the network target. This is a limitation of the WSB wizard; use wbadmin + folders by date (as in the script above).
- The scheduler hangs or asks for a password. Run from SYSTEM with Run with highest privileges; check the Log on as a batch job right and the -ExecutionPolicy Bypass arguments.
- No space for VSS. Increase the quota on the volume (10–20%), check the shadow creation/deletion schedule.