Read Symantec Backup Exec Job Report XML Files

' Basic Routine to Read / Parse XML Job Reports created
' by Symantec Backup Exec.

Dim serverName, backupJobFile, el, jobName, startDateTime, endDateTime, jobStatus
Dim fso,XMLDoc

Set fso = CreateObject("Scripting.FileSystemObject")

backupJobFile ="c:\xml\m.xml"

Set xmlDoc = CreateObject("Msxml2.DOMDocument")


Set el = xmlDoc.getElementsByTagName("machine_name")
serverName = el.item(0).Text

Set el = xmlDoc.getElementsByTagName("name")
jobName = Replace(el.item(0).Text,"Job name: ","")

Set el = xmlDoc.getElementsByTagName("start_time")
startDateTime = Replace(el.item(0).Text,"Job started: ","")

Set el = xmlDoc.getElementsByTagName("end_time")
endDateTime = Replace(el.item(0).Text,"Backup completed on ","")
Set el = xmlDoc.getElementsByTagName("engine_completion_status")
jobStatus = Replace(el.item(0).Text,"Job completion status: ","")

Wscript.Echo serverName
Wscript.Echo jobName
Wscript.Echo startDateTime
Wscript.Echo endDateTime
Wscript.Echo jobStatus


Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Creating a simple Alert / Success Message with ASP.NET/VB using Bootstrap