次の方法で共有


Enable-AzRecoveryServicesBackupAutoProtection

The Enable-AzRecoveryServicesBackupAutoProtection cmdlet sets up automatic protection of current and any future SQL DBs within the given instance with the supplied policy.

構文

Default (既定)

Enable-AzRecoveryServicesBackupAutoProtection
    [-InputItem] <ProtectableItemBase>
    [-BackupManagementType] <BackupManagementType>
    [-WorkloadType] <WorkloadType>
    [-Policy] <PolicyBase>
    [-PassThru]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

説明

This command allows users to automatically protect all existing unprotected SQL DBs and any DB which will be added later with the given policy. Since the instruction is to back up all future DBs, the operation is done at a SQLInstance level, Azure backup service will then regularly scan auto-protected containers for any new DBs and automatically protect them.

Example 1

$Pol = Get-AzRecoveryServicesBackupProtectionPolicy -Name "DefaultSQLPolicy"
$SQLInstance = Get-AzRecoveryServicesBackupProtectableItem -workloadType MSSQL -ItemType SQLInstance -VaultId $targetVault.ID -Name "MSSQLInstance" -ServerName "TestSQLServer"
Enable-AzRecoveryServicesBackupAutoProtection -InputItem $SQLInstance -BackupManagementType AzureWorkload -WorkloadType MSSQL -Policy $Pol -VaultId $targetvault.ID

The first cmdlet gets a default policy object, and then stores it in the $Pol variable. The second cmdlet fetches the relevant SQLInstance which is a protectable item. The 3rd command then sets up auto protection for this instance using the policy in $Pol.

Example 2

This commands allows users to automatically protect all existing unprotected DBs and any DB which will be added later with the given policy. (autogenerated)

Enable-AzRecoveryServicesBackupAutoProtection -BackupManagementType AzureVM -InputItem <ProtectableItemBase> -Policy $Pol -VaultId $vault.ID -WorkloadType AzureVM

パラメーター

-BackupManagementType

The class of resources being protected. Currently the values supported for this cmdlet are MAB, AzureWorkload, AzureVM

パラメーターのプロパティ

型:BackupManagementType
規定値:None
指定可能な値:AzureWorkload
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:1
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Confirm

Prompts you for confirmation before running the cmdlet.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:cf

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DefaultProfile

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

パラメーターのプロパティ

型:IAzureContextContainer
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-InputItem

Specifies the protectable item object that can be passed as an input. The current supported value is a protectableItem object of type "SQLInstance".

パラメーターのプロパティ

型:ProtectableItemBase
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:0
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PassThru

Return the result for auto protection.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Policy

Protection policy object.

パラメーターのプロパティ

型:PolicyBase
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:3
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-VaultId

ARM ID of the Recovery Services Vault.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:True
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-WhatIf

Shows what would happen if the cmdlet runs.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:wi

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-WorkloadType

Workload type of the resource. The current supported values are AzureVM, WindowsServer, MSSQL

パラメーターのプロパティ

型:WorkloadType
規定値:None
指定可能な値:MSSQL, SAPHanaDatabase
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:2
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

入力

String

出力

Object