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")
xmlDoc.load(backupJobFile)
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
' 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")
xmlDoc.load(backupJobFile)
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
Comments
Post a Comment