Domain Controller Backup Script


#run once
#Install-WindowsFeature windows-server-backup -IncludeAllSubFeature
#run once
#import-Module WindowsServerBackup
$wbpolicy = New-WBPolicy

$volume = Get-WBVolume -VolumePath C:
Add-WBVolume -Policy $wbpolicy -Volume $volume

Add-WBSystemState $wbpolicy
Add-WBBareMetalRecovery $wbpolicy

$backupLocation = New-WBBackupTarget -volumePath z:
Add-WBBackupTarget -Policy $wbpolicy -Target $backupLocation

Set-WBVssBackupOptions -Policy $wbpolicy -VssCopyBackup

Start-WBBackup -Policy $wbpolicy

#schedule a backup task if you like
#Set-WBSchedule -Policy $WBpolicy -Schedule 08:00,12:00,16:00,20:00
#Set-WBPolicy -Policy $WBpolicy

Leave a Reply

Your email address will not be published. Required fields are marked *