We are using Powershell to create our Veeam report and email it.
This all worked fine untill i was requested to implement this for the tape jobs as well.
the code I use to get my tape jobs is the following:
Code: Select all
#tape job
$Job = Get-VBRTapeJob
$AllBackupSessions += [Veeam.Backup.Core.CBackupSession]::GetByJob($Job.Id) | select Name,Result,State,EndTime,CreationTime,AuxData | where {$_.Creationtime -like $today}
#backup job
$AllBackupSessions += Get-VBRBackupSession | select Name,Result,State,EndTime,CreationTime,AuxData | sort-object Name | where {$_.Creationtime -like $yesterday -Or $_.Creationtime -like $today}
- Tape job:
Code: Select all
Name : Daily Hyper-V Tape Offload
Result : Success
State : Stopped
EndTime : 6/04/2016 2:05:56
CreationTime : 6/04/2016 2:00:12
AuxData : <TapeAuxData><TapeLibrary Name="HP 1x8 G2 AUTOLDR 4.30" /><TapeMediums><TapeMedium Barcode="RES006L5" Name="RES006L5" /></TapeMedium
s><CBackupSessionWorkDetails><WorkDuration>3434720704</WorkDuration></CBackupSessionWorkDetails><SessionStarterInfo Version="1" User
Name="s_veeam" UserDomainName="RETAIL" RunManually="False" /></TapeAuxData>
Code: Select all
Name : Daily Hyper-V Backup (Incremental)
Result : Warning
State : Stopped
EndTime : 6/04/2016 1:29:40
CreationTime : 5/04/2016 22:00:00
AuxData : <AuxData><CBackupStats><BackupSize>7493309440</BackupSize><DataSize>18323183216</DataSize><DedupRatio>87</DedupRatio><CompressRatio>
46</CompressRatio></CBackupStats><CBackupSessionWorkDetails><WorkDuration>125797112149</WorkDuration></CBackupSessionWorkDetails><Se
ssionStarterInfo Version="1" UserName="s_veeam" UserDomainName="RETAIL" RunManually="False" /></AuxData>
And since I"m working in Powershell now I would like to keep it this way.
For complete reference, here is the complete result for a tape job object:
Code: Select all
BottleneckManager : CJobBottleneckManager
Info : Veeam.Backup.Model.CBackupSessionInfo
Progress : Veeam.Backup.Model.CBackupProgressData
StartupMode : Normal
JobSourceType : NET
CurrentPointId : 00000000-0000-0000-0000-000000000000
OriginalSessionId : 14e9340f-7bf5-46c8-80a1-1a29c408a284
IsFullMode : True
IsRetryMode : False
IsQuickBackup : False
IsVeeamZip : False
IsPlannedFailover : False
IsReplicaFromBackup : False
IsAdHocBackup : False
PostActivity : AskService
Name : Daily Hyper-V Tape Offload
OrigJobName : Daily Hyper-V Tape Offload
BackupStats : Veeam.Backup.Model.CBackupStats
WorkDetails : Veeam.Backup.Core.CBackupSessionWorkDetails
WillBeRetried : False
IsManuallyStopped : False
IsTransformLaunched : False
SessionCryptoSpec : Veeam.Backup.Crypto.CCryptoSymmetricSpec
UserCryptoSpec :
SelectiveProcessingSpec :
StorageVerificationResult : Veeam.Backup.Core.CStorageVerificationResultContainer
IsEncryptionEnabled : False
SessionInfo : Veeam.Backup.Model.CBackupSessionInfo
Id : 14e9340f-7bf5-46c8-80a1-1a29c408a284
JobType : VmTapeBackup
JobName : Daily Hyper-V Tape Offload
JobSpec :
JobTypeString : Other job type
Operation :
Description :
BaseProgress : 100
IsCompleted : True
IsWorking : False
IsStarting : False
IsPostprocessing : False
JobId : 2dfa4ec0-afab-4a9f-90ec-cbb9ff3fb654
Result : Success
State : Stopped
EndTime : 6/04/2016 2:05:56
CreationTime : 6/04/2016 2:00:12
AuxData : <TapeAuxData><TapeLibrary Name="HP 1x8 G2 AUTOLDR 4.30" /><TapeMediums><TapeMedium Barcode="RES006L5" Name="RES006L5" /
></TapeMediums><CBackupSessionWorkDetails><WorkDuration>3434720704</WorkDuration></CBackupSessionWorkDetails><SessionSt
arterInfo Version="1" UserName="s_veeam" UserDomainName="RETAIL" RunManually="False" /></TapeAuxData>
IsLowerAgentPriority : False
LogName : Job.Daily_Hyper-V_Tape_Offload
LogsSubFolder : Daily_Hyper-V_Tape_Offload
Logger : Veeam.Backup.Core.XmlLogger
Tracer : Veeam.Backup.Core.CSessionLogTracer
Thanks in advance,
Thomas