Windows server backup powershell

I’ve migrated freshly a Domajor Controller based on Windows 2008 R2 to Windows 2012 and I took the chance to dig right into the Back-up cmdlets.

You watching: Windows server backup powershell

Before trying to upgrade it, I wanted to take a complete backup of the mechanism state plus the crucial partition where the operating device has been set up so that I might restore the server simply in instance points go wrong.

See more: How To Bypass Factory Reset Protection ( Frp Bypass Note 5, Frp Bypass Galaxy Note 5 Android 7

As a prerequisite, you may need to define a backup strategy. Even if it’s not 100% suitable for corporate settings, you have the right to additionally discover a good instance on this page: Scott Hanselman’s standard non-cloud-based personal backup strategy

Hands on! First, we need some server attributes to be added:

Import-Module ServerManager Get-WindowsFeature | ? $_.DisplayName -match "Backup" Add-WindowsFeature -Name Backup-Features -IncludeAllSubFeature:$true -Restart:$false The above regulates will install the complying with 3 features:


Add-WindowsFeature -Name Windows-Server-Backup -Restart:$falseNow, we deserve to load the module that consists of the cmdlets for backup operations:

Add-Pssnapin windows.serverbackupEverything has actually been streamlined on Windows 2012, you just should include a solitary backup feature and the module preloading feature renders it available automatically

Add-WindowsFeature -Name Windows-Server-Back-up -Restart:$false


Tbelow are 30 cmdallows on Windows 2008 R2 vs. 49 in Windows Server 2012. Here’s the list of the 19 new cmdlets:


I digress, let’s stick to the backup of my 2008 R2 Doprimary Controller:

Get inventory data

# Check if there"s a policy in area Get-WBPolicy # List disks and their properties Get-WBDisk

NB: In my case, HP disk 0 is a RAID 1 through 2 volumes (C: & D:) + I’ve got a spare disk as volume E:. Only C: is actually crucial.Create a brand-new Windows Backup plan object# Create an empty plan object $pol = New-WBPolicy
Connumber desired backup settings# Set the "BareMetalRecovery (BMR)" checkbox to true $pol | Add-WBBareMetalRecovery # Set the System state checkbox to true $pol | Add-WBSystemState # Back-up all important quantities Add-WBVolume -Policy $pol -Volume (Get-WBVolume -CriticalVolumes) # Add a tarobtain volume where the backup documents will certainly be composed $targetvol = Get-WBDisk | Wbelow $_.Properties -enhance "ValidTarget" | Get-WBVolume Add-WBBackupTarget -Policy $pol -Targain (New-WBBackupTaracquire -Volume $targetvol) # Set a schedule Set-WBSchedule -Policy $pol -Schedule (::Now.AddMinutes(10))
Launch itStart-WBBack-up -Policy $polRewatch the result# Get a review of formerly run backup operations. Get-WBOutline # Get details from the backup taracquire files Get-WBBackupSet -BackupTarget (Get-WBBackupTaracquire $pol) # Gets the condition of the last backup project from the backup events in the event manager. Get-WBJob -Previous 1
I took 3 minutes to backup the C: drive of my DC and to develop a 30GB Vhd file utilizing a VSS snapswarm.Without PowerShell, I can have also ssuggest provided this one-liner to launch and backup the C: drive:

wbadmin.exe begin backup -backupTarget:E: -include:C:

Before upgrading a doprimary controller, the schema of the woodland requirements to be extended otherwise the setup wizard ends with the adhering to warning:

Active Directory on this domajor controller does not contain Windows Server 2012 ADPREP /FORESTPREP updays. See

See more: Taptip.Exe - Can I Disable Tabtip

Here is the best totally comprehensive technet web page around the upgrading Doprimary Controllers to Windows Server 2012

In my situation I easily typed the adhering to command to confirm that the account I was making use of is a member of the abouve groups.

net user /dom $env:USERNAMEFinally, prior to completing the setup wizard, I extended the schema with these two commands: