Remove-WBBackupSet

Removes backups from a target catalog, a system catalog, or both.

Syntax

Default (Default)

Remove-WBBackupSet
    [[-BackupSet] <WBBackupSet[]>]
    [[-KeepVersions] <Int32>]
    [[-MachineName] <String>]
    [-DeleteOldest]
    [-Force]
    [<CommonParameters>]

WBBackupTarget

Remove-WBBackupSet
    [[-BackupSet] <WBBackupSet[]>]
    [[-KeepVersions] <Int32>]
    [-BackupTarget] <WBBackupTarget>
    [[-MachineName] <String>]
    [-DeleteOldest]
    [-Force]
    [<CommonParameters>]

VolumePath

Remove-WBBackupSet
    [[-BackupSet] <WBBackupSet[]>]
    [[-KeepVersions] <Int32>]
    [-VolumePath] <String>
    [[-MachineName] <String>]
    [-DeleteOldest]
    [-Force]
    [<CommonParameters>]

NetworkWithPSCred

Remove-WBBackupSet
    [[-BackupSet] <WBBackupSet[]>]
    [[-KeepVersions] <Int32>]
    [-NetworkPath] <String>
    [[-Credential] <PSCredential>]
    [[-MachineName] <String>]
    [-DeleteOldest]
    [-NonInheritAcl]
    [-Force]
    [<CommonParameters>]

Description

The Remove-WBBackupSet cmdlet removes a set of backups from a target catalog, a system catalog, or both.

Examples

Example 1: Remove oldest backup set

PS C:\> $Ret = Remove-WBBackupSet -DeleteOldest -BackupTarget $WB_BackupTarget -MachineName $MachineName -Force

This command deletes the oldest backup of the computer that has its name in the $MachineName variable from the backup target and stores the result in the variable named $Ret. Because the command includes the Force parameter, it does not ask for confirmation of the deletion.

Parameters

-BackupSet

Specifies an array of backup set objects that determine which backup or which backup sets that this cmdlet removes. You can specify one backup or an array of backup sets.

Parameter properties

Type:

WBBackupSet[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-BackupTarget

Specifies a backup target object that indicates the storage location with the backups that you want to remove.

Use this parameter to delete backups from computers other than the local computer. The cmdlet deletes the backup sets from the catalog on the computer that you specify in this parameter and from the system catalog of the local computer. These locations can be locally attached disk drives or remote shared folders.

Parameter properties

Type:WBBackupTarget
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WBBackupTarget
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies a PSCredential object that contains the username and password for a user account that has access permissions for the location that stores backups.

To obtain a credential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NetworkWithPSCred
Position:4
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-DeleteOldest

Indicates that the cmdlet removes the oldest backup in the set.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:7
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-KeepVersions

Specifies the number of the most recent backups to keep on the backup target. The cmdlet removes backups over this number from the target.

If you specify this parameter along with the BackupTarget and MachineName parameters, the cmdlet examines the target location on the specified computer for backups to remove.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MachineName

Specifies the name of the computer for which this cmdlet removes backups.

Use this parameter when you specify the BackupTarget parameter or when multiple computers store backups in the same location.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NetworkPath

Specifies the path to the remote shared folder from which the cmdlet removes backups.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NetworkWithPSCred
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NonInheritAcl

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NetworkWithPSCred
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VolumePath

Specifies the drive letter of the volume where the cmdlet stores backups.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VolumePath
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

Microsoft.Windows.ServerBackup.Commands.WBBackupSet

PSCredential

Outputs

Object