Share via


Remove-WBPolicy

Remove-WBPolicy

Removes the currently set backup policy (WBPolicy object).

Syntax

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

Detailed Description

The Remove-WBPolicy cmdlet removes the currently set backup policy (WBPolicy object). This stops the existing scheduled daily backups from running and frees the disk used for the backup storage location (if the backup storage location was a disk). If no scheduled backup (no WBPolicy object) is currently set, then no operation is performed.

Parameters

-All <SwitchParameter>

Removes the WBPolicy that is set in the system.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-Force <SwitchParameter>

Specifies to not prompt the user for confirmation.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-Policy <WBPolicy>

Specifies the backup policy (WBPolicy object) to update.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

true (ByPropertyName)

Position?

named

-CommonParameter

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

Input and Return Types

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

Notes

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

  • To use Windows Server Backup cmdlets, you must be a member of the Administrators group or Backup Operators group.

Examples

EXAMPLE 1

C:\PS>Remove-WBPolicy -All

None

Description

-----------

Removes the currently set WBPolicy object of the system. This will disable all scheduled backups on the system. (This can be used with the -Force parameter to suppress prompting for confirmation.)

EXAMPLE 2

C:\PS>Remove-WBPolicy -Policy $policy

None

Description

-----------

Removes the WBPolicy object $policy if it is the currently set policy of the system. This will disable all scheduled backups on the system. (This can be used with the -Force parameter to suppress prompting for confirmation.)

See Also

Reference

Get-WBPolicy
New-WBPolicy