Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Task scheduler to create Shadow Copy

From Tech-Wiki


Practical configuration and operational reference for Task scheduler to create Shadow Copy.

Procedure

Create a daily task with high privileges and following action:

Program: wmic
Parameter: shadowcopy call create Volume=C:\

If it's requried to increase the size of Shadow Storage:

vssadmin Resize ShadowStorage /For=C: /On=C: /MaxSize=20%

To create this via Powershell use:

$volumeinfo = GWMI -namespace root\cimv2 -class win32_volume 
$volumeid = $volumeinfo[1].deviceid 
$taskname = "ShadowCopyVolume" + $volumeid.replace("\","").replace("?Volume","") 
$taskrun = "C:\Windows\system32\vssadmin.exe Create Shadow /AutoRetry=15 /For=$volumeid" 
schtasks /create /F /RU SYSTEM /SC DAILY /ST 08:00 /RI 240 /DU 48:00 /K /V1 /TN $TaskName /TR "$taskrun" 

Command above is for server only, on desktop use one of these:

(gwmi -list win32_shadowcopy).Create('C:\','ClientAccessible') 
wmic shadowcopy call create Volume='C:\'

See also