你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzRecoveryServicesBackupProtectableItem
This command will retrieve all protectable items within a certain container or across all registered containers. It will consist of all the elements of the hierarchy of the application. Returns DBs and their upper tier entities like Instance, AvailabilityGroup etc.
Syntax
Get-AzRecoveryServicesBackupProtectableItem
[[-Container] <ContainerBase>]
[-WorkloadType] <WorkloadType>
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRecoveryServicesBackupProtectableItem
[[-Container] <ContainerBase>]
[-WorkloadType] <WorkloadType>
[[-ItemType] <ProtectableItemType>]
[-Name <String>]
[-ServerName <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRecoveryServicesBackupProtectableItem
[-ParentID] <String>
[[-ItemType] <ProtectableItemType>]
[-Name <String>]
[-ServerName <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzRecoveryServicesBackupProtectableItem cmdlet gets the list of protectable items in a container and the protection status of the items. A container that is registered to an Azure Recovery Services vault can have one or more items that can be protected.
Examples
Example 1
$Vault = Get-AzRecoveryServicesVault -Name "MyRecoveryVault"
$Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVMAppContainer -VaultId $Vault.Id
$Item = Get-AzRecoveryServicesBackupProtectableItem -Container $Container -ItemType "SQLInstance" -WorkloadType "MSSQL" -VaultId $Vault.ID
The first command gets the container of type MSSQL, and then stores it in the $Container variable. The second command gets the Backup protectable item in $Container, and then stores it in the $Item variable.
Parameters
-Container
Container where the item resides
Type: | ContainerBase |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
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 |
-ItemType
Specifies the type of protectable item. Applicable values: (SQLDataBase, SQLInstance, SQLAvailabilityGroup).
Type: | ProtectableItemType |
Accepted values: | SQLDataBase, SQLInstance, SQLAvailabilityGroup |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of the Database, Instance or AvailabilityGroup.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ParentID
Specified the ARM ID of an Instance or AG.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServerName
Specifies the name of the server to which the item belongs.
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 |
-WorkloadType
Workload type of the resource. The current supported values are AzureVM, WindowsServer, AzureFiles, MSSQL
Type: | WorkloadType |
Accepted values: | AzureVM, WindowsServer, AzureFiles, MSSQL |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
System.String