編集

Set-AzRecoveryServicesBackupItemSourceScanConfiguration

Configures Source Scan (Microsoft Defender for Cloud) for a Backup-protected item.

Syntax

Default (Default)

Set-AzRecoveryServicesBackupItemSourceScanConfiguration
    [-Item] <ItemBase>
    [-State] <String>
    [-Force]
    [-PassThru]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzRecoveryServicesBackupItemSourceScanConfiguration cmdlet enables or disables Source Scan (Microsoft Defender for Cloud) for an Azure VM (Virtual Machine) Backup-protected item. Source Scan lets Microsoft Defender for Cloud scan the item's recovery points for malware and other threats. The alias Set-AzRecoveryServicesBISourceScanConfiguration is also available.

Currently, only Azure VM backup items are supported. Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet, or pass the -VaultId parameter, before you use the current cmdlet.

Examples

Example 1: Enable Source Scan for an Azure VM backup item

$vault = Get-AzRecoveryServicesVault -Name "vaultName" -ResourceGroupName "resourceGroupName"
$Cont = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM -VaultId $vault.ID
$PI = Get-AzRecoveryServicesBackupItem -Container $Cont[0] -WorkloadType AzureVM -VaultId $vault.ID
Set-AzRecoveryServicesBackupItemSourceScanConfiguration -Item $PI[0] -State Enabled -VaultId $vault.ID -PassThru

The first command gets an array of backup containers, and then stores it in the $Cont array. The second command gets the Backup item corresponding to the first container item, and then stores it in the $PI variable. The last command waits for Source Scan to be enabled and returns the updated backup item.

Example 2: Disable Source Scan for an Azure VM backup item without confirmation

$vault = Get-AzRecoveryServicesVault -Name "vaultName" -ResourceGroupName "resourceGroupName"
$item = Get-AzRecoveryServicesBackupItem -VaultId $vault.ID -BackupManagementType AzureVM -WorkloadType AzureVM
Set-AzRecoveryServicesBackupItemSourceScanConfiguration -Item $item[0] -State Disabled -VaultId $vault.ID -Force

The first cmdlet fetches the AzureVM backup items for the recovery services vault. The second cmdlet disables Source Scan for $item[0] without prompting for confirmation. The command waits for the operation to complete and produces no output.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Item

Specifies the backup item for which Source Scan (Microsoft Defender for Cloud) is to be configured. To obtain an item, use the Get-AzRecoveryServicesBackupItem cmdlet.

Parameter properties

Type:ItemBase
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Returns the updated backup item after the Source Scan configuration operation completes.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-State

Specifies the Source Scan state to set for the item. Allowed values are "Enabled", "Disabled".

Parameter properties

Type:String
Default value:None
Accepted values:Enabled, Disabled
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VaultId

ARM ID of the Recovery Services Vault.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Inputs

ItemBase

String

Outputs

ItemBase