May 4 2011

Schedule SCCM reports to be emailed without SQL reporting services

I recently had a requirement to be able to email SCCM reports on a schedule in an environment without SQL reporting services. I achieved this by creating a VB script to create an email that has the report ASP page as the body of the email. The script I used and scheduled as a Windows scheduled task was:

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Computers that do NOT have ......"
objMessage.From = "from@email.address"
objMessage.To = "to@email.address"
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("") = ""
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("") = 25
'==End remote SMTP server configuration section==
'The line below shows how to send a webpage from a remote site
objMessage.CreateMHTMLBody "http://serverURL/SMSReporting_P00/Report.asp?ReportID=422"

Just change the variables for your environment.

I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.