Bewerken

Delen via


Set-AzRecoveryServicesResourceGuardMapping

Sets the resource guard mapping to the recovery services vault.

Syntax

Set-AzRecoveryServicesResourceGuardMapping
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   -ResourceGuardId <String>
   [-Token <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Sets the resource guard mapping to the recovery services vault. This cmdlet creates a mapping between the RS vault and Resource guard, after this cmdlet is run, sensitive operations are protected by the resource guard as per MUA.

Examples

Example 1 Create a resource guard mapping in a cross tenant scenario

$token = (Get-AzAccessToken -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Token
Set-AzRecoveryServicesResourceGuardMapping -VaultId $vault.ID -ResourceGuardId "Resource-Guard-Id" -Token $token

The first command fetches the access token for the resource guard tenant where the resource guard is present. The second command creates a mapping between the RSVault $vault and Resource guard. Please note that token parameter is optional and only needed to authenticate cross tenant protected opeartions.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGuardId

ResourceGuardId of the ResourceGuard to be mapped with RecoveryServicesVault

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Token

Auxiliary access token for authenticating critical operation to resource guard subscription

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

ResourceGuardProxyBaseResource