Freigeben über


Set-OBPolicyState

Sets the PolicyState of the current backup policy object. The state can be either Valid or Paused.

Syntax

Default (Standardwert)

Set-OBPolicyState
    [-Policy] <CBPolicy>
    [-State] <OMPolicyStates>
    [-Confirm]
    [-WhatIf]

Beschreibung

This cmdlet can be used to set the current state of the backup policy. The state can be either Valid or Paused.

A Valid state means that the backups will happen based on the defined schedule and that backups will be retained based on the retention policy.

A Paused state means that backups will not occur according to the defined schedule that the current backups will be retained until the backup policy is changed to Valid state or is deleted.

Beispiele

EXAMPLE 1

 $P = Get-OBPolicy
 Set-OBPolicyState   $P "Valid"
 Set-OBPolicy   $P

This example sets the OBPolicyState to Valid and updates the OBPolicy object.

EXAMPLE 2

 $P = Get-OBPolicy
 Set-OBPolicyState   $P "Paused"
 Set-OBPolicy   $P

This example sets the OBPolicyState to Paused and updates the OBPolicy object.

EXAMPLE 3

 Get-OBPolicy | Set-OBPolicyState -State "Paused" | Set-OBPolicy

This example sets the OBPolicyState to Paused and updates the OBPolicy object using pipelines.

Parameter

-Confirm

Prompts you for confirmation before running the cmdlet.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:False
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Policy

Specifies the backup policy (OBPolicy) object on which to set the PolicyState.

Parametereigenschaften

Typ:CBPolicy
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:2
Obligatorisch.:True
Wert aus Pipeline:True
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-State

The current PolicyState of the backup policy.

Parametereigenschaften

Typ:OMPolicyStates
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:3
Obligatorisch.:True
Wert aus Pipeline:True
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-WhatIf

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

Parametereigenschaften

Typ:SwitchParameter
Standardwert:False
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

Eingaben

Microsoft.Internal.CloudBackup.Commands.OBPolicy

Ausgaben

Microsoft.Internal.CloudBackup.Commands.OBPolicyState