external help file | ms.assetid | online version | schema |
---|---|---|---|
Microsoft.Azure.Commands.RecoveryServicesRdfe.dll-Help.xml |
1415BBA3-3F55-46A9-B20B-DFA72342BDF4 |
2.0.0 |
Sets the state for a Site Recovery protection entity.
[!INCLUDE rdfe-banner]
Set-AzureSiteRecoveryProtectionEntity -ProtectionEntity <ASRProtectionEntity>
[-ProtectionProfile <ASRProtectionProfile>] -Protection <String> [-OSDiskName <String>] [-OS <String>]
[-WaitForCompletion] [-Force] [-Profile <AzureSMProfile>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-AzureSiteRecoveryProtectionEntity -Id <String> -ProtectionContainerId <String>
[-ProtectionProfile <ASRProtectionProfile>] -Protection <String> [-OSDiskName <String>] [-OS <String>]
[-WaitForCompletion] [-Force] [-Profile <AzureSMProfile>] [-WhatIf] [-Confirm] [<CommonParameters>]
The Set-AzureSiteRecoveryProtectionEntity cmdlet enables or disables protection on an Azure Site Recovery protection entity.
PS C:\> $ProtectionContainer = Get-AzureSiteRecoveryProtectionContainer -Name "Cloud17"
PS C:\> $ProtectionEntity = Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $ProtectionContainer -Name "VM01"
PS C:\> Set-AzureSiteRecoveryProtectionEntity -ProtectionEntity $ ProtectionEntity -Protection Enable -ProtectionProfile $ProtectionContainer.AvailableProtectionProfiles[0] -OS Windows
The first command gets containers for the current Azure Site vault by using the Get-AzureSiteRecoveryProtectionContainer cmdlet, and then stores it in the $ProtectionContainer variable.
The second command gets the protected virtual machines that belong to the container stored in $ProtectionContainer by using the Get-AzureSiteRecoveryProtectionEntity cmdlet. The command stores the results in the $ProtectionEntity variable.
The final command enables protection for the entities stored in $ProtectionEntity.
Forces the command to run without asking for user confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the ID of a protected virtual machine for which to enable or disable protection.
Type: String
Parameter Sets: ByIDs
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the operating system type. The acceptable values for this parameter are:
- Windows
- Linux
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the disk that contains the operating system.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Type: AzureSMProfile
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies whether protection should be enabled or disabled. The acceptable values for this parameter are:
- Enable
- Disable
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the ID of a protected container. This cmdlet enables or disables protection for a virtual machine that belongs to the container that this parameter specifies.
Type: String
Parameter Sets: ByIDs
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the protection entity object.
Type: ASRProtectionEntity
Parameter Sets: ByPEObject
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies a protection profile to enable protection. Specify an ASRProtectionProfile object that is one of the available protection profiles in the associated protection container.
Type: ASRProtectionProfile
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Indicates that the cmdlet waits for the operation to complete before it returns control to the Windows PowerShell console.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-AzureSiteRecoveryProtectionContainer