vss

By steve, 10 April, 2014

the following powershell can be used to find all VSS scheduled tasks and alter the minutes to a random value.

$TaskService = new-object -comobject "Schedule.Service"
$TaskService.Connect()

$Folder = $TaskService.GetFolder("\")
$Task = $folder.GetTasks(0) | where {$_.Name.StartsWith("ShadowCopyVolume")}

if($Task.GetType().BaseType.Name -eq "Array") {
exit 1
}

$SetMinute=Get-Random -Minimum 1 -Maximum 59
$TaskDef=$Task.Definition