Get-AzureSiteRecoveryVM
Hämtar information om Site Recovery-hanterade virtuella datorer.
Kommentar
De cmdletar som refereras i den här dokumentationen är till för att hantera äldre Azure-resurser som använder Service Management-API:er. Se Az PowerShell-modulen för cmdletar för att hantera Azure Resource Manager-resurser.
Syntax
Get-AzureSiteRecoveryVM
-ProtectionContainer <ASRProtectionContainer>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Get-AzureSiteRecoveryVM
-Id <String>
-ProtectionContainer <ASRProtectionContainer>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Get-AzureSiteRecoveryVM
-Id <String>
-ProtectionContainerId <String>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Get-AzureSiteRecoveryVM
-Name <String>
-ProtectionContainer <ASRProtectionContainer>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Get-AzureSiteRecoveryVM
-Name <String>
-ProtectionContainerId <String>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Get-AzureSiteRecoveryVM
-ProtectionContainerId <String>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
Cmdleten Get-AzureSiteRecoveryVM hämtar information om virtuella datorer som hanteras i Azure Site Recovery.
Exempel
Exempel 1: Hämta information om en virtuell dator
PS C:\> $ProtectionContainer = Get-AzureSiteRecoveryProtectionContainer
PS C:\> Get-AzureSiteRecoveryVM -ProtectionContainer $ProtectionContainer
ID : a205fd17-3848-4896-bab6-9dbccc3cd8ed
ServerId : 4a94c4a9-c856-4577-afbd-367fe9b3ce9c
ProtectionContainerId : 4a94c4a9-c856-4577-afbd-367fe9b3ce9c_1c513d45-645d-4ed0-b9ae-e7b869a1f7fc
Name : vm1
Type : VirtualMachine
FabricObjectId : 86447b9e-d877-4e9a-8302-adcd6bbf18c0
Protected : False
CanCommit : False
CanFailover : True
CanReverseReplicate : False
ActiveLocation : Primary
ProtectionState : Enabled
ReplicationHealth : Healthy
TestFailoverState : None
ReplicationProvider : HyperVReplica
Det första kommandot använder cmdleten Get-AzureSiteRecoveryProtectionContainer för att hämta en skyddad container och lagrar den sedan i variabeln $ProtectionContainer.
Det andra kommandot hämtar information om de virtuella datorerna i $ProtectionContainer.
Parametrar
-Id
Anger ID:t för den virtuella datorn som information ska hämtas om.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Anger namnet på den virtuella datorn.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Profile
Anger den Azure-profil som den här cmdleten läser från. Om du inte anger någon profil läser den här cmdleten från den lokala standardprofilen.
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProtectionContainer
Anger site recovery-skyddscontainerobjektet.
Type: | ASRProtectionContainer |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProtectionContainerId
Anger ID för en skyddad container som information ska hämtas om.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |