Remove-WBPolicy

Remove-WBPolicy

Removes the backup policy.

Syntax

Parameter Set: Default
Remove-WBPolicy [[-Policy] <WBPolicy> ] [-All] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-WBPolicy cmdlet removes the WBPolicy object. This cmdlet stops scheduled daily backups from running. If the backup storage location is a disk, the cmdlet frees the disk. If the system does not have a scheduled backup, the cmdlet does not do anything.

To use this or any other Windows Server 2012 Backup cmdlets, you must be a member of the Administrators group or Backup Operators group.

Parameters

-All

Indicates that this cmdlet removes the WBPolicy object that is set in the system.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Removes a policy without prompting you for confirmation. By default, the cmdlet prompts you for confirmation before it proceeds.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Policy<WBPolicy>

Specifies the backup policy object to update.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

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

  • WBPolicy

    This cmdlet specifies the WBPolicy object to remove.

Outputs

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

  • None

    None

Notes

  • The WBPolicy object must be in edit mode. To put the WBPolicy object in edit mode for a policy that is set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the Editable parameter. The New-WBPolicy cmdlet creates a WBPolicy object that is already in edit mode.

Examples

Example 1: Remove all scheduled backups

This command removes the currently set WBPolicy object and disables all scheduled backups on the system. The command also uses the Force parameter to suppress the confirmation message.

PS C:\> Remove-WBPolicy -All -Force

Example 2: Remove a specified backup policy

This command store the result of the Get-WBPolicy cmdlet in the variable named $Policy, then removes the WBPolicy object, which disables all scheduled backups on the system.

PS C:\> $Policy = Get-WBPolicy
PS C:\> Remove-WBPolicy -Policy $Policy

Get-WBPolicy

New-WBPolicy

Set-WBPolicy