Export (0) Print
Expand All

Start-WBBackup

Windows Server 2012 R2 and Windows 8.1

Updated: October 17, 2013

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

Start-WBBackup

Starts a one-time backup operation.

Syntax

Parameter Set: Policy
Start-WBBackup [-Policy] <WBPolicy> [[-Async]] [[-Force]] [[-AllowDeleteOldBackups]] [[-DonotVerifyMedia]] [ <CommonParameters>]




Detailed Description

The Start-WBBackup cmdlet starts a one-time backup operation.

You can use the settings from an existing backup policy for the scheduled backup by specifying a WBPolicy object, or you can start a backup by using new settings. If you use new settings to create a backup, you must do the following:

     -- Specify the items to include in the backup by using the Add-WBVolume, Add-WBFileSpec, Add-WBSystemState, and Add-WBBareMetalRecovery cmdlets.

     -- Specify the location for backup storage by using the locations already defined in a WBBackupTarget object or by updating an object of that type.

Before you can add a backup target to a WBPolicy object, put the WBPolicy object in edit mode. To put the WBPolicy object in edit mode for a policy that you have set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the Editable parameter. The Get-WBPolicy cmdlet creates a new WBPolicy object that is already in edit mode.

To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.

Parameters

-AllowDeleteOldBackups

If specified, then deleting backups of older versions of the operating system is enabled.


Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Async

Indicates that Windows PowerShell returns immediately after the backup starts and does not display status messages. If you specify this parameter and choose not to display status messages, you can use the Get-WBJob cmdlet to get the status of the currently running backup operation.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DonotVerifyMedia

Do not use. This parameter is not implemented in this version of the module.


Aliases

none

Required?

false

Position?

5

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Indicates that the backup starts automatically without prompting the user for confirmation.


Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Policy<WBPolicy>

Specifies a WBPolicy object that includes the policy settings for the backup by using an existing backup policy object.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • WBPolicy

    The Start-WBBackup cmdlet uses a WBPolicy object to determine what to include in the backup and where to store the backup.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • String

    If you do not specify the Async parameter, the Start-WBBackup cmdlet displays status messages from the currently running backup as strings. If you specify the Async parameter, you can use the Get-WBJob cmdlet to get the status of the currently running backup operation.


Examples

Example 1: Start a backup by using new settings

This example starts a backup by using new settings.


 

The first command creates a new backup policy object and stores it in a variable named $Policy.


PS C:\> $Policy = New-WBPolicy

 

The next command creates a backup source, adds the file named "C:\15-12-08_1645.jpg" to the backup source, and stores the backup source in a variable named $FileSpec.


PS C:\> $FileSpec = New-WBFileSpec -FileSpec C:\15-12-08_1645.jpg

 

This command associates the backup source in the $FileSpec variable with the backup policy in the $Policy variable.


PS C:\> Add-WBFileSpec -Policy $Policy -FileSpec $FileSpec

 

This command stores the volume that has the drive letter F: in the variable named $Volume.


PS C:\> $Volume = Get-WBVolume -VolumePath F:

 

This command stores the volume in the $Volume variable in the backup policy in the $Policy variable.


PS C:\> Add-WBVolume -Policy $Policy -Volume $Volume

 

This command adds the current system state options to the backup policy in the $Policy variable.


PS C:\> Add-WBSystemState $Policy

 

This command adds the ability to perform a bare-metal recovery to the backup policy in the $Policy variable.


PS C:\> Add-WBBareMetalRecovery $Policy

 

This command creates a new backup location object that contains the volume that has the drive letter D: and then stores that object in the $BackupLocation variable.


PS C:\> $BackupLocation = New-WBBackupTarget -VolumePath D:

 

This command adds the backup target based on the backup policy in the $Policy variable and the backup location in the $BackupLocation variable.


PS C:\> Add-WBBackupTarget -Policy $Policy -Target $BackupLocation

 

This command specifies that the backup policy in the $Policy variable uses Volume Shadow Copy Service (VSS) copy backups.


PS C:\> Set-WBVssBackupOptions -Policy $Policy -VssCopyBackup

 

This command starts the backup by using the backup policy in the $Policy variable.


PS C:\> Start-WBBackup -Policy $Policy

Example 2: Start a backup by using backup policy settings

This example starts a backup by using the settings for scheduled backups defined in a backup policy.

The first command gets the current backup policy and stores it in the variable named $Policy.

The second command starts the backup. Because the command specifies the Async parameter, the cmdlet returns immediately.

The third command gets the backup status and stores it in the variable named $BackupJob. Because the second command includes the Async parameter, you can view the backup status by using the Get-WBJob cmdlet.


PS C:\> $Policy = Get-WBPolicy
PS C:\> Start-WBBackup -Policy $policy -Async
PS C:\> $BackupJob = Get-WBJob

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft