PowerShell script exchange
Post Reply
jcolonfzenpr
Veeam Vanguard
Posts: 41
Liked: 31 times
Joined: Dec 30, 2021 1:16 am
Full Name: Jonathan Colon
Location: Puerto Rico
Contact:

v12.1 powershell module SureBackup object types

Post by jcolonfzenpr »

Happy Holidays,

With the 12.1 version of the powershell module, the "Get-VBRSureBackupJob" cmdlet includes two types of object definition:

1. TypeName: Veeam.Backup.PowerShell.Infos.VBRViSureBackupJob
2. TypeName: Veeam.Backup.PowerShell.Infos.VBRSureBackupContentScanJob

Code: Select all

PS C:\Users\jocolon> $A | gm    

   TypeName: Veeam.Backup.PowerShell.Infos.VBRViSureBackupJob

Name                        MemberType Definition
----                        ---------- ----------
Equals                      Method     bool Equals(System.Object obj)
GetHashCode                 Method     int GetHashCode()
GetType                     Method     type GetType()
ToString                    Method     string ToString()
ApplicationGroup            Property   Veeam.Backup.PowerShell.Infos.VBRApplicationGroup ApplicationGroup {get;}
Description                 Property   string Description {get;}
Id                          Property   guid Id {get;}
IsEnabled                   Property   bool IsEnabled {get;}
KeepApplicationGroupRunning Property   bool KeepApplicationGroupRunning {get;}
LastResult                  Property   Veeam.Backup.PowerShell.Infos.VBRSessionResult LastResult {get;}
LastRun                     Property   datetime LastRun {get;}
LastState                   Property   Veeam.Backup.PowerShell.Infos.VBRSessionState LastState {get;}
LinkedJob                   Property   Veeam.Backup.PowerShell.Infos.VBRSureBackupLinkedJob[] LinkedJob {get;}
LinkToJobs                  Property   bool LinkToJobs {get;}
MaxConcurrentVMs            Property   int MaxConcurrentVMs {get;}
Name                        Property   string Name {get;}
NextRun                     Property   datetime NextRun {get;}
ProcessRandomMachines       Property   bool ProcessRandomMachines {get;}
RandomMachinesMaxCount      Property   int RandomMachinesMaxCount {get;}
ScheduleEnabled             Property   bool ScheduleEnabled {get;}
ScheduleOptions             Property   Veeam.Backup.PowerShell.Infos.VBRSureBackupJobScheduleOptions ScheduleOptions {get;}
VerificationOptions         Property   Veeam.Backup.PowerShell.Infos.VBRSureBackupJobVerificationOptions VerificationOptions {get;}
VirtualLab                  Property   Veeam.Backup.PowerShell.Infos.VBRVirtualLab VirtualLab {get;}


   TypeName: Veeam.Backup.PowerShell.Infos.VBRSureBackupContentScanJob

Name                   MemberType Definition
----                   ---------- ----------
Equals                 Method     bool Equals(System.Object obj)
GetHashCode            Method     int GetHashCode()
GetType                Method     type GetType()
ToString               Method     string ToString()
Description            Property   string Description {get;}
Id                     Property   guid Id {get;}
IsEnabled              Property   bool IsEnabled {get;}
LastResult             Property   Veeam.Backup.PowerShell.Infos.VBRSessionResult LastResult {get;}
LastRun                Property   datetime LastRun {get;}
LastState              Property   Veeam.Backup.PowerShell.Infos.VBRSessionState LastState {get;}
LinkedJob              Property   Veeam.Backup.PowerShell.Infos.VBRSureBackupLinkedJob[] LinkedJob {get;}
LinkToJobs             Property   bool LinkToJobs {get;}
MaxConcurrentVMs       Property   int MaxConcurrentVMs {get;}
Name                   Property   string Name {get;}
NextRun                Property   datetime NextRun {get;}
ProcessRandomMachines  Property   bool ProcessRandomMachines {get;}
RandomMachinesMaxCount Property   int RandomMachinesMaxCount {get;}
ScheduleEnabled        Property   bool ScheduleEnabled {get;}
ScheduleOptions        Property   Veeam.Backup.PowerShell.Infos.VBRSureBackupJobScheduleOptions ScheduleOptions {get;}
VerificationOptions    Property   Veeam.Backup.PowerShell.Infos.VBRSureBackupJobVerificationOptions VerificationOptions {get;}

PS C:\Users\jocolon>
Frankly I have never seen this type of situation and my question is, how do I differentiate between the two?

I know I can monkey patch a solution because the SureBackup platform lacks a Virtual Lab and Application Pool, but looking in the Veeam console there are three types of SureBackup working platform.

1. VMware
2. Hyper-V
2. SureBackup

Image

Is there a property value on the object that store the value of the platform or a job type?

Regards,
Jonathan Colon
https://techmyth.blog/
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: v12.1 powershell module SureBackup object types

Post by oleg.feoktistov » 1 person likes this post

Hi Jonathan,

Although SureBackup job objects don't hold type properties, you can differentiate them by calling .GetType() on each job instance and then write your logic around it. Example:

Code: Select all

$jobs = Get-VBRSureBackupJob
foreach ($job in $jobs) {
  $jobType = $job.GetType()
  $job | select Name, @{n='Type';e={$jobType}}
}
Best regards,
Oleg
jcolonfzenpr
Veeam Vanguard
Posts: 41
Liked: 31 times
Joined: Dec 30, 2021 1:16 am
Full Name: Jonathan Colon
Location: Puerto Rico
Contact:

Re: v12.1 powershell module SureBackup object types

Post by jcolonfzenpr »

Thanks for the help, it was exactly what I was looking for.
Jonathan Colon
https://techmyth.blog/
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests