Tuesday, March 9, 2010

CSV Output of "Get all List of all Archives and all relevent information" using VBscript.

Source: Symantec Website: link below.
http://www.symantec.com/connect/downloads/csv-output-get-all-list-all-archives-and-all-relevent-information-using-vbscript

All credit goes to Wayne Humphrey for writing the SQL query which retrieves this very useful information from the database. This is simply a wrapper which I wrote in vbscript to output the information to a .csv file.

I have not included this in the main script, however to email the output you would need to append something like this to the bottom of the script.

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "subject"
objMessage.From = "your_from_address"
objMessage.To = "your_to_address"
objMessage.HTMLBody = "body"
objMessage.AddAttachment OutputFile

objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "your_email_server"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send

I have blanked out my own environment settings and replaced them with fill-ins.

You will need to rename: EV-User-Report.txt to EV-User-Report.vbs & SQLQuery.txt to SQLQuery.sql

Hope someone gets some use out of this.

Jeremy.

No comments: