A quick Powershell script example using the Windows Server 2012 Windows Backup cmdlets to perform a backup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$targetvol = Get-WBVolume -AllVolumes | ?{$_.MountPoint -eq '\\?\Volume{3fb5e457-8f43-4cfc-a481-39924c26ec4b}'} $c_drive = Get-WBVolume -AllVolumes | ?{$_.MountPoint -eq '\\?\Volume{c3a23855-4888-11e3-80b4-806e6f6e6963}'} $sys_drive = Get-WBVolume -AllVolumes | ?{$_.MountPoint -eq '\\?\Volume{c3a23854-4888-11e3-80b4-806e6f6e6963}'} $target = New-WBBackupTarget -Volume $targetvol $policy = New-WBPolicy Add-WBBackupTarget -Policy $policy -Target $target Add-WBBareMetalRecovery -Policy $policy Add-WBSystemState -Policy $policy Add-WBVolume -Policy $policy -Volume $c_drive Add-WBVolume -Policy $policy -Volume $sys_drive Set-WBVssBackupOption -Policy $policy -VssFullBackup Start-WBBackup -Policy $policy |
I obtained the volume GUIDs using:
1 |
Get-WBVolume -AllVolumes |