Step 4 - Create Snapshots with Diskshadow

Microsoft Platform Guide

Audience
Public
Source Type
Documentation

Create Diskshadow script or manually enter commands to create snapshots.

Open elevated command prompt and enter the following commands. Please adjust the ADD VOLUME commands as necessary with appropriate drive letters. The SqlServerWriter is shown below adding the AdventureWorks2014 database.

PowerShell Example:


Remove-Item VSS-TEST.dsh -ErrorAction SilentlyContinue
Remove-Item VSS-TEST.CAB -ErrorAction SilentlyContinue
$dsh = "./VSS-TEST.dsh"
"RESET",
"SET CONTEXT PERSISTENT",
"SET OPTION TRANSPORTABLE",
"SET VERBOSE ON",
"BEGIN BACKUP",
#F: Array1
"ADD VOLUME F: PROVIDER {781c006a-5829-4a25-81e3-d5e43bd005ab}",
#G: Array2
"ADD VOLUME G: PROVIDER {781c006a-5829-4a25-81e3-d5e43bd005ab}",
"CREATE",
"END BACKUP" | Set-Content $dsh
DISKSHADOW /s $dsh
Remove-Item $dsh