Export (0) Print
Expand All

Set-OBPolicyState

Windows Server 2012 R2 and Windows 8.1

Updated: October 17, 2013

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

Set-OBPolicyState

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

Syntax

Parameter Set: Default
Set-OBPolicyState [-Policy] <CBPolicy> [-State] <OMPolicyStates> [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

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.

Parameters

-Policy<CBPolicy>

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


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-State<OMPolicyStates>

The current PolicyState of the backup policy.


Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByValue)

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.

Inputs

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

  • Microsoft.Internal.CloudBackup.Commands.OBPolicy

Outputs

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

  • Microsoft.Internal.CloudBackup.Commands.OBPolicyState

Examples

EXAMPLE 1

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


PS C:\> $P = Get-OBPolicy
PS C:\> Set-OBPolicyState  $P “Valid”
PS C:\> Set-OBPolicy   $P 

EXAMPLE 2

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


PS C:\> $P = Get-OBPolicy
PS C:\> Set-OBPolicyState $P “Paused”
PS C:\> Set-OBPolicy $P 

EXAMPLE 3

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


PS C:\> Get-OBPolicy | Set-OBPolicyState -State "Paused" | Set-OBPolicy

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft