Condividi tramite


Add-DPMRecoveryTarget

Add-DPMRecoveryTarget

Grants the DPM role permission to recover to a location.

Syntax

Parameter Set: Default
Add-DPMRecoveryTarget [-DpmRole] <DpmRole> [-RecoveryTargets] <TargetRecoveryItem[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Add-DPMRecoveryTarget cmdlet grants the System Center 2012 – Data Protection Manager (DPM) role permission to recover to a location.

Parameters

-DpmRole<DpmRole>

Specifies a DPM role that this cmdlet modifies. To obtain a DPM role object, use the Get-DPMRole cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RecoveryTargets<TargetRecoveryItem[]>

Specifies an array of target recovery items which consist of the instance of SQL Server and the folder to use for alternate instance recovery.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

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

Outputs

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

Examples

Example 1: Grant a role permission to recover to a location

The first command gets a DPM role named OpsMgrSQL, and then stores the result in the $DpmRole variable.

The second command gets the recovery target for the role stored in the $DpmRole variable, and then stores the result in the $RecoveryTargetInstance variable.

The final command grants the DPM role stored in $DpmRole permission to recover to the target instance of SQL Server stored in $RecoveryTargetInstance.

PS C:\> $DpmRole = Get-DPMRole -Name "OpsMgrSQL"
PS C:\> $RecoveryTargetInstance = Get-DPMRecoveryTarget -DpmRole $DpmRole -Type SQLInstance
PS C:\> Add-DPMRecoveryTarget -Role $DpmRole -RecoveryTargets $RecoveryTargetInstance

Get-DPMRole