Windows Server Backup Cmdlets in Windows PowerShell

This topic introduces the Windows PowerShell cmdlets for Windows Server Backup that can be used to create and manage backups in Windows Server 2008 R2.

The cmdlets for Windows Server Backup are contained in a Windows PowerShell snap-in. Before you begin, you must install the cmdlet snap-in. (For instructions, see Install Windows Server Backup Tools (https://go.microsoft.com/fwlink/?LinkID=101794)). Then, each time you use the cmdlets, you must add the Windows Server Backup cmdlet snap-in to the instance of Windows PowerShell that you have opened by using the following command at the command prompt: C:\PS>add-pssnapin windows.serverbackup.

By default, Windows PowerShell modules and snap-ins are not loaded in Windows PowerShell. To start Windows PowerShell so that all of the Windows PowerShell modules and snap-ins are loaded automatically, right-click the Windows PowerShell icon in the taskbar, and then click Import all modules. In Windows Server 2008 R2, the Windows PowerShell icon is pinned to the taskbar by default. However, you must start Windows PowerShell one time to make the Import all modules task appear.

Windows Server Backup cmdlets

This section lists Windows PowerShell cmdlets for Windows Server Backup in Windows Server 2008 R2. They are listed in alphabetical order based on the verb at the beginning of the cmdlet.

Note

To use the Windows PowerShell cmdlets for Windows Server Backup, you must be a member of the Backup Operators or Administrators group, or you must have been delegated the appropriate authority.

Cmdlet name Cmdlet use

Add-WBBackupTarget

Adds the WBBackupTarget object, which specifies backup storage locations, to the backup policy (WBPolicy object).

Add-WBBareMetalRecovery

Adds the needed items to the backup policy to enable you to perform a bare metal recovery later with backups created using that policy.

Add-WBFileSpec

Adds the WBFileSpec object, which specifies the items to include or exclude from a backup, to the backup policy.

Add-WBSystemState

Adds the items needed to the backup policy, so that later you can use backups created with this policy to perform a system state recovery.

Add-WBVolume

Adds the list of source volumes to the backup policy.

Get-WBBackupSet

Gets the list of backups (WBBackupSet objects) that were created for a server and stored at a location that you specified.

Get-WBBackupTarget

Gets the locations for storing backups that you specified as part of the backup policy.

Get-WBBareMetalRecovery

Gets the value that indicates whether the ability to perform bare metal recoveries from backups has been added to the backup policy.

Get-WBDisk

Gets the list of internal and external disks that are online for the local computer.

Get-WBFileSpec

Gets the list of WBFileSpec objects that are associated with the specified backup policy.

Get-WBJob

Gets the operation that is currently running (WBJob object).

Get-WBPolicy

Gets the current backup policy that is set for the computer.

Get-WBSchedule

Gets the current schedule for backups in the backup policy.

Get-WBSummary

Gets the history of the backup operations performed.

Get-WBSystemState

Gets a Boolean value that indicates whether the ability to perform system state recoveries with the backups has been added to the backup policy.

Get-WBVolume

Gets the list of source volumes for the backup that is included in the backup policy.

Get-WBVssBackupOptions

Gets a setting that specifies whether the backups created using the backup policy will be Volume Shadow Copy Service (VSS) copy backups or VSS full backups.

New-WBBackupTarget

Creates a new WBBackupTarget object.

New-WBFileSpec

Creates a new WBFileSpec object.

New-WBPolicy

Creates a new WBPolicy object.

Remove-WBBackupTarget

Removes the backup storage locations (defined by the WBBackupTarget object) from the backup policy.

Remove-WBBareMetalRecovery

Removes the request to include all items needed for a bare metal recovery from the current backup policy.

Remove-WBFileSpec

Removes the list of items to include or exclude from a backup (as specified by the WBFileSpec object) from a backup policy.

Remove-WBPolicy

Removes the backup policy that is currently set.

Remove-WBSystemState

Removes the request to include all items needed for a system state recovery from the current backup policy.

Remove-WBVolume

Removes the volume to back up (specified by the WBVolume object) from the backup policy.

Set-WBPolicy

Sets the WBPolicy object as the backup policy that will be used for scheduled backups.

Set-WBSchedule

Sets the times to create daily backups for the backup policy.

Set-WBVssBackupOptions

Sets a value that specifies whether the backups that are created using the backup policy are VSS copy backups or VSS full backups.

Start-WBBackup

Starts a one-time backup operation.

Additional references