Search-AzDataProtectionJobInAzGraph

Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entries

Syntax

Search-AzDataProtectionJobInAzGraph
      -Subscription <String[]>
      -DatasourceType <DatasourceTypes>
      [-ResourceGroup <String[]>]
      [-Vault <String[]>]
      [-StartTime <DateTime>]
      [-EndTime <DateTime>]
      [-Operation <JobOperation[]>]
      [-Status <JobStatus[]>]
      [-DefaultProfile <PSObject>]
      [<CommonParameters>]

Description

Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entries

Examples

Example 1: Get all jobs in a certain time range

$endtime = Get-Date
$starttime = $endtime.AddHours(-5)
Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime

Name                                 Type
----                                 ----
1c1d56c2-b21a-4038-ba46-3c1a0089e66a microsoft.dataprotection/backupvaults/backupjobs
79f2804d-a39d-487e-91b5-f2eceffcbb7a microsoft.dataprotection/backupvaults/backupjobs
96238abd-6ff3-48e0-8c07-0eabd6928a17 microsoft.dataprotection/backupvaults/backupjobs

This command gets all jobs in a vault in last 5 hours.

Example 2: Get all jobs of a certain operation type

Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup

Name                                 Type
----                                 ----
11bc277d-9448-446a-9e79-4721858524d6 microsoft.dataprotection/backupvaults/backupjobs
16d7b56a-e169-41d1-aa10-cafcc19c8e12 microsoft.dataprotection/backupvaults/backupjobs
1b0b17e3-398f-4265-9d03-ffc1e21fa73a microsoft.dataprotection/backupvaults/backupjobs

This command gets all ondemand backup jobs in a vault.

Parameters

-DatasourceType

Datasource Type

Type:DatasourceTypes
Accepted values:AzureDisk, AzureBlob, AzureDatabaseForPostgreSQL, AzureKubernetesService, AzureDatabaseForPGFlexServer, AzureDatabaseForMySQL
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndTime

End Time filter for the Backup Job

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Operation

Operation filter for the backup job

Type:JobOperation[]
Accepted values:OnDemandBackup, ScheduledBackup, Restore
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroup

Resource Group of Vault

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StartTime

Start Time filter for the backup Job

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Status

Status filter for the backup job

Type:JobStatus[]
Accepted values:InProgress, Completed, Failed
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Subscription

Subscription of Vault

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Vault

Name of the vault

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

PSObject