The Power of Point-in-Time Backups
In a corporate file server environment, the most common IT helpdesk ticket is an employee accidentally overwriting a massive Excel spreadsheet or permanently deleting a folder they shouldn’t have. Restoring that single file from a tape backup or an external cloud archive can take hours.
Windows Server solves this natively with the Volume Shadow Copy Service (VSS), commonly known as “Previous Versions.” When enabled on a volume, VSS takes highly efficient, block-level snapshots of the hard drive at scheduled intervals (e.g., 7:00 AM and 12:00 PM). Because these snapshots only record the delta changes (the blocks that were actually modified), they consume very little disk space. If an employee deletes a file at 2:00 PM, they can simply right-click the folder in Windows Explorer, select “Restore Previous Versions,” and instantly retrieve the 12:00 PM snapshot of the file without ever calling the IT department.
While you can configure VSS by right-clicking a drive in File Explorer, PowerShell allows administrators to easily deploy and manage these critical snapshots across dozens of massive storage arrays.
Step 1: Enabling Shadow Copies on a Volume
To interact with the VSS subsystem, you must run PowerShell with elevated Administrator privileges. We will be using the native WMI methods, as standard PowerShell cmdlets for VSS configuration are somewhat limited.
To enable Shadow Copies on the D: drive (your primary file share), execute the following command:
Invoke-WmiMethod -Class Win32_ShadowCopy -Name Create -ArgumentList "D:\"
The moment this command executes, the VSS engine spins up and takes the very first snapshot of the D: drive. You have successfully enabled the feature.
Step 2: Configuring Storage Limits
By default, Windows will allow the Shadow Copy snapshots to consume up to 10% of the total volume size before it begins aggressively deleting the oldest snapshots to make room for new ones. If you have a massive 10TB SAN, 10% (1TB) might be entirely too much wasted space.
You can use the vssadmin command-line utility directly within PowerShell to restrict the maximum storage allocation. For example, to restrict the snapshots on the D: drive to a strict maximum of 50GB:
vssadmin Resize ShadowStorage /For=D: /On=D: /MaxSize=50GB
If the snapshots reach the 50GB boundary, Windows will seamlessly prune the oldest shadow copies to keep the database under the limit.
Step 3: Taking an Ad-Hoc Snapshot
If you are about to execute a massive, risky PowerShell script that will rename thousands of files across the D: drive, you should take an immediate, ad-hoc snapshot just in case the script fails.
Invoke-WmiMethod -Class Win32_ShadowCopy -Name Create -ArgumentList "D:\"
This creates a perfect point-in-time recovery block. If the script corrupts the files, you can instantly revert the entire drive.
Step 4: Listing Existing Snapshots
To audit exactly how many snapshots are currently stored on the system and how much space they are consuming, run:
Get-WmiObject -Class Win32_ShadowCopy | Select-Object DeviceObject, InstallDate, VolumeName | Format-Table -AutoSize
The output will display the exact timestamp of every shadow copy currently held in the database.