Administer Azure Backup with Windows PowerShell

Updated: June 2, 2015

Applies To: Windows Server 2008 R2 with SP1, Windows Server 2012

This section contains information about the Windows PowerShell cmdlets that are available for Microsoft Azure Backup. To use the Online Backup (OB) cmdlets, you must be a member of the Administrators group or the Backup Operators group. You can view the list of available cmdlets by using the following cmdlet:

get-command -module MSOnlineBackup

To get the online Help for the cmdlet, download the Help files by using the following cmdlet:

Update-Help –module MSOnlineBackup

You can view additional information about a specific cmdlet by using the following cmdlet and specifying the cmdlet name:

Get-Help -cmdletname

Azure Backup cmdlets

The following table describes the available Windows PowerShell cmdlets for use with Microsoft Azure Backup. Click the cmdlet name for more details about the cmdlet.

Windows PowerShell cmdlet Description

Add-OBFileSpec

Adds the OBFileSpec object, which specifies the items to include or exclude from a backup, to the backup policy (OBPolicy) object. The OBFileSpec object can include or exclude multiple files, folders, or volumes. The list of items to include can be defined by using the New-OBFileSpec cmdlet, and then you can update the OBPolicy object.

Get-OBAllRecoveryPoints

Gets all available recovery points. During recovery after the authentication process is complete, a list of recovery points for each successful backup that was completed from a specific server is shown to the user. The user can choose to restore date from within a specific recovery point.

Get-OBAlternateBackupServer

Gets the array of OBBackupServer objects. This array represents all of the servers that are associated with the specified backup account except the local server. Valid credentials are required to obtain this array.

Get-OBCertificateListFromLocalStore

Gets the list of certificates from the local computer certificate store. You can use the certificates that the cmdlet returns to register the current computer with Azure Backup using the Start-OBRegistration cmdlet.

Get-OBFileSpec

Gets the list of OBFileSpec objects that are associated with the specified backup policy (OBPolicy) object. The OBFileSpec objects define what items will be included or excluded from backups created using the backup policy. Use the New-OBFileSpec and Add-OBFileSpec cmdlets to define and apply changes to the backup policy.

Get-OBJob

Gets a list of operations from a server as OBJob objects.

Get-OBMachineSetting

Gets the OBMachineSetting object for the server. This object contains the server properties settings, including proxy server settings that are used by online backup to access the Internet, bandwidth throttling settings, and the encryption passphrase that will be required to decrypt the files during recovery to another server.

Get-OBMachineUsage

Gets the amount of storage that is consumed by the Microsoft Azure Backup as data that is backed up from this server. This would represent the data available across all recoverable points.

Get-OBNotification

Gets the array of OBNotification objects for the server. The OBNotification object contains the following details regarding the notification.

  1. Category of notification

  2. Type of notification

  3. Time of generation of notification

  4. Error codes for long and short descriptions

  5. Error message parameters

If a server is unregistered with the online backup service, the event log is not cleared. This can return notifications that are generated by a previous registration if a server is reregistered with the online backup server. However, if the Azure Backup Agent is uninstalled completely from the server the event logs are deleted.

Get-OBPolicy

Gets the current backup policy that is set for the server, including the details about how to schedule backups, files that are included in the backup, and the retention policy.If the Editable parameter is used, when the changes are done, the updated policy should be set as the current policy by using the Set-OBPolicy cmdlet.

Get-OBRecoverableItem

Gets the list of OBRecoverableItem objects that are associated with the specified online backup server (OBServer) object. The OBRecoverableItem objects define which items will be recovered from the list of backup items.

Get-OBRecoverableSource

Gets the list of data sources that are recoverable from this server or the specified OBBackupServer object. This list is used to get an item-level recovery.

Get-OBRecoveryService

Gets the list of available backup vaults.

Get-RetentionPolicy

Gets the current retention policy for backups from the backup policy (OBPolicy) object. The retention policy allows the number of retention days to be set to one of the following values: 7, 15, 30.

Get-OBSchedule

Gets the current schedule for backups in the backup policy (OBPolicy) object. Backups are run at the times specified in the schedule. To change the schedule, use the Set-OBSchedule cmdlet.

Get-OBInitialBackupCreationMethod

Need description and link cmdlet to list.

New-OBInitialBackupCreationMethod

Need description and link cmdlet to list.

New-OBFileSpec

Creates a new OBFileSpec object that is based on specified parameters. The OBFileSpec object defines what items will be included or excluded from backups.

Multiple files, folders, or volumes can be included or excluded. Volume paths can be specified by using volume drive letters, volume mount points, or GUID-based volume names. If a GUID-based volume name is specified, it should be terminated with a backslash (\). The wildcard character (*) can be used in the file name when you are specifying a path to a file or when specifying a file type to include or exclude.

The items in the OBFileSpec object can be specified to be recursive (include the item and everything subordinate to the item in the file structure) or non-recursive (include only the item).

New-OBPagingContext

Creates a new OBPagingContext object that is used in the Get-OBRecoverableItem cmdlet to enable searching and browsing of paginated recoverable items. Providing the OBPagingContext object intelligently retrieves paginated files and folders within the destination folder.

This cmdlet only needs to be called once during a session and the OBPagingContext object will be automatically refreshed when browsing or searching under different folders. If the OBPagingContext object is not supplied with the Get-OBRecoverableItem cmdlet, the cmdlet will page repeatedly during the process to retrieve and return all items listed recursively in the folder.

If the OBPagingContext object is supplied, rerunning the same cmdlet returns the second page, the third page, and so on until the last page is retrieved.

New-OBPolicy

Creates a new, empty backup policy (OBPolicy) object. Other cmdlets are used to define which items will be included or excluded in backups, when the backups will run, and where backups will be stored. When the policy has been configured, use the Set-OBPolicy cmdlet to use the policy actively for scheduled backups.

New-OBRecoveryOption

Specifies the recovery options that will apply to all the recoverable items. These include the recovery destination path, an overwrite flag if the object already exists, and security settings for the object. If the recovery option is not specified, the following default settings are used during recovery:

  1. Restore to original location

  2. Create copies if there is a conflict

  3. Restore the ACLs of the files

New-OBRetentionPolicy

Creates a new OBRetentionPolicy, which specifies the number of days to retain the backed up items. Retention days must be specified as 7, 15, or 30. Other integers are not supported.

New-OBSchedule

Creates a new OBSchedule object, which specifies when the backup should happen in terms of days of the week and times of the day. If not otherwise specified, the backup is scheduled to occur at 9:00 PM every Sunday.

Remove-OBFileSpec

Removes the list of items to include or exclude from a backup (as specified by the OBFileSpec object) from a backup policy (OBPolicy) object. To remove the file specification list from the backup policy the OBPolicy object must be in edit mode. To put the OBPolicy object in edit mode for a policy that has been set as the scheduled backup policy, use the Get-OBPolicy cmdlet with the Editable parameter. The New-OBPolicy cmdlet creates a new OBPolicy object that is already in edit mode.

Remove-OBPolicy

Removes the currently set backup policy (OBPolicy) object. This stops the existing scheduled daily backups. If the DeleteBackup parameter is specified, data that is backed up according to this policy on the online backup server is deleted. If the DeleteBackup parameter is not specified, the existing backups are retained in accordance with the retention policy that was in effect when the backup was created.

Set-OBInitialBackupCreationMethod

Need description and link to cmdlet list.

Set-OBMachineSetting

Sets an OBMachineSetting object for the server that includes proxy server settings for accessing the internet, network bandwidth throttling settings, and the encryption passphrase that is required to decrypt the files during recovery to another server.

Set-OBPolicy

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

Set-OBRetentionPolicy

Sets the retention policy for the backup policy (OBPolicy) object. The allowed retention days for the OBRetentionPolicy object are 7, 15, or 30.

Set-OBSchedule

Sets the OBSchedule object (which includes the days of the week and times of day to create daily backups) for the backup policy (OBPolicy) object.

Start-OBBackup

Starts a one-time backup operation. Set the Policy parameter to specify the settings for the backup.

Start-OBRecovery

Recovers the array of OBRecoverableItem objects with the specified recovery options in the OBRecoverableOptions object. If no recovery option is specified, the following default options are used:

  1. Restore to original location

  2. Create copies if there is a conflict

  3. Restore the ACLs of the files

If you are performing alternate server recovery, you must specify the credential and encryption passphrase objects to perform the recovery. During an alternate server recovery, this cmdlet displays an error message if the OBRecoverableOptions object is not specified because there is no default original location available during recovery from another server.

Start-OBRegistration

Registers the server with the backup vault by using the specified certificate.

Stop-OBJob

Stops a currently running backup or recovery job.

Rename-OBVolume

Used to map a backed up volume to its new name.

New-OBRecoverableItem

Creates a new OBRecoverable item with a given relative path. This file path would be used to recover the file item from a recovery point.