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
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
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.
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.
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.