Table of contents
TLS
TOC
Collapse the table of content
Expand the table of content

Remove-WBPolicy

Brian Lich|Last Updated: 4/3/2017

SYNOPSIS

Removes the backup policy.

SYNTAX

Remove-WBPolicy [[-Policy] <WBPolicy>] [-All] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

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 cmdlet, you must be a member of the Administrators group or Backup Operators group.

EXAMPLES

Example 1: Remove all scheduled backups

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

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.

Example 2: Remove a specified backup policy

PS C:\> $Policy = Get-WBPolicy
PS C:\> Remove-WBPolicy -Policy $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.

PARAMETERS

-All

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Policy

Specifies the backup policy object that this cmdlet updates.

Type: WBPolicy
Parameter Sets: (All)
Aliases: 

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-WhatIf

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

WBPolicy

This cmdlet specifies the WBPolicy object to remove.

OUTPUTS

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.

Get-WBPolicy

New-WBPolicy

Set-WBPolicy

© 2017 Microsoft