Pinterest Stumbleupon Whatsapp
Ads by Google

Imagine a future world, where you’re having lunch with some friends and suddenly your phone makes an SMS ding. You recognize the sound as the alert tone you set for your computer issues. Checking the note, you read: “Computer Alert: Your home computer system has had 3 hacking attempts.”

The whole concept of having systems in place that could alert you to any and all issues with your computers isn’t really in the science fiction realm anymore. We’ve covered all kinds of useful remote techniques to monitor your computers, like setting up Growl notifications Set Up Growl Notifications Between Different Computers And Devices Set Up Growl Notifications Between Different Computers And Devices Read More , monitoring computer health How To Use SpeedFan to Remotely Monitor Computer Health How To Use SpeedFan to Remotely Monitor Computer Health Read More  with SpeedFan, or simply connecting to your systems remotely How to Use Remote Desktop Connections Like an IT Pro How to Use Remote Desktop Connections Like an IT Pro If you work in the IT department of a company that has an internal network, the odds are pretty good that you've had to make use of Remote Desktop once or twice. Remote Desktop is... Read More  using Remote Desktop.

Having your computer send individual notifications for specific computer problems could take a lot of work, especially because it involves diagnosing what could sometimes be pretty complex problems, and then sending the SMS through your router out into the Internet. Doable, yes. Easy, no.  So, what if your computer could send you a full health report in the form of all of your various computer log files for you to troubleshoot your home computer issues or identify concerns, no matter where you are located in the world?

That’s what we’re going to do today – create an automated notification system where your computer will collect important log files and computer status information and then send all of that to you in the form of an archived file every day via email.

Tools Needed For Your Automated Notification System

To set up this system on your home computer, you’re going to need a few software tools that we’re then going to piece together and make them work in harmony. First, download and install Microsoft Security Essentials. This will perform all of the computer scans and logfile collections, and then package it all up nicely in an archive file.

Also, make sure that you’re signed up for an IFTTT account and try creating a few recipes 5 Unusual IFTTT Recipes You May Not Have Thought Of 5 Unusual IFTTT Recipes You May Not Have Thought Of You've got the folks at IFTTT who make web automation look like childs play. It's quite impressive. I decided to finally start digging through IFTTT to see if I could come up with a few... Read More , so you get used to it. You’ll also need a Dropbox account that’ll store your final reports (although not entirely necessary). You can check out or Dropbox guide The Unofficial Guide To Dropbox The Unofficial Guide To Dropbox There's more to Dropbox than you might think: you can use it for file sharing, backing up your data, syncing files between computers and even remotely control your computer. Read More for help setting it up. Finally, follow my Blat setup guide Easily Send Command Line Emails with Blat [Windows] Easily Send Command Line Emails with Blat [Windows] Blat. Not exactly the word you envision would be the name of a tool that you can use to send out emails to anyone in the world, from any application or software tool that you... Read More to install the Blat command-line email tool.

Ads by Google

Setting Up MS Security Essentials

Once you have those four tools installed and ready to go, it’s time to schedule tasks that’ll collect your computer information and email it out.

Microsoft Security Essentials provides command line parameters you can use to package up log files. The command to do this is “mpcmdrun.exe -Getfiles -Scan”. You can find the executable in the c:\program files\microsoft security client\ folder. When you run that command from the prompt, this is what the script looks like.

security-report2

It takes less than a minute to run, and then it packages all of the files into a CAB file and places it in the c:\ProgramData\Microsoft\Microsoft Antimalware\Support\ folder as “MySupportFiles.cab”.

security-report3

As you can see, there’s a lot of information that gets accumulated and put in the CAB file – log files, system info, security threat info, product registration info, and more.  The first thing you want to do is run this as a scheduled job every day. The easiest way to do this, so you don’t have to worry about the path (with spaces in it), is set up the path in your Path system variable – Control Panel -> System -> Advanced System Settings -> Environment Variables.

Click “Path” under System variables, and enter in “;c:\program files\microsoft security client\” at the end of the Variable value field. While you’re in there, also add the directory where you placed Blat.exe as well, so that the next step in this process works without any issues.

security-report7

Now (after you reboot) you could just open any command prompt and type “mpcmdrun.exe”, and it would launch Microsoft Security Essentials.

Time to set up the scheduled task! Go to Control Panel -> Administrative Tools -> Computer Management -> Computer Management -> Task Scheduler”.

Create a new task and set it up to run every day at a specific time. To run the program, change the action to “Start a program”, enter “mpcmdrun.exe” in the Program/script field, and type “-GetFiles -Scan” in the “Add arguments” field.

security-report9

In my case, I set it up to run at 8AM every day, first thing in the morning.

security-report8

What you have working now is that MS Security Essentials will recreate a new, updated copy of the MySupportFiles.cab file in c:\ProgramData\Microsoft\Microsoft Antimalware\Support\.

Automatically Emailing System Status

The next step is to grab that file and send it to your email account. Whether you check your email from your hotel while you’re traveling or from your phone while you’re waiting at the doctor’s office, you will receive the notification from your computer with the attached data files.

With Blat set up on your machine (see the guide link at the start of this article), you can run the following command from the command prompt to send the file to any email address you like:

blat -body “Here’s today’s file” -to myemail@gmail.com -subject “PC Log Files” -attach “c:\programdata\microsoft\microsoft antimalware\support\MPSupprtFiles.cab”

You can run this as a new scheduled task (just like you did for MS Security Essentials), but just use “blat” as the program/script (because you already set up the PATH variable above). For the parameters, just use the rest of the command shown above, and use your own email address that you’d like to send the files to.

security-report11
If you schedule this task to run an hour after Microsoft Security Essentials creates the CAB file, then you’ll automatically get the latest, freshest copy of the file with all of your computer’s latest data. Just open the file with any Unzip tool that works with CAB files, and you can review your computer’s status data, and identify any issues no matter where you are.

Storing Your Health Report in Dropbox

Now, if you really want to go above and beyond and store those log files in the cloud, all you need to do is set up a filter in your email client to look for all incoming emails with the subject you set in your Blat command. In my case it was “PC Log Files”.

security-report6

Have this filter automatically set a label for that email as “PC Log Files.” We’ve offered help in the past with setting up filters How to Set Up Email Filters in Gmail, Yahoo Mail, and Outlook How to Set Up Email Filters in Gmail, Yahoo Mail, and Outlook Email filtering is your best tool in keeping your inbox neat and organized. Here's how to set up and use email filters in Gmail, Yahoo Mail, and Outlook. Read More , if you need it.

Next, you’ll need to create an IFTTT recipe to watch your email account for any email with that label (you’ll need to be using an email service IFTTT works with). If you’re just getting started with IFTTT, our useful IFTTT guide can really help.

security-report4

The trigger will be the email label. The action will be extracting the attached file and putting it in your Dropbox account. This is pretty easy if you just choose Dropbox as the output option and select “Add file from URL”.

security-report5

This will place the email attachment into your Dropbox folder “PC Reports”, as shown below.

security-report10

This Is How This Will Work

So, at this point in your project, here’s what you’ve accomplished. Every day at a certain time, your computer will now automatically run MS Security Essentials and will collect and compact all of the latest log files and reports into one convenient zip file. About an hour later, your computer will automatically email that report file to your email address, and a copy will also be bounced to your Dropbox account for easy access and safekeeping.

Honestly, could automation make life any easier?

Would you use any kind of Windows automation like this? Are there any other interesting uses can can envision using this kind of automation for? Share your own ideas and projects in the comments section below!

  1. Chip Dizzy
    November 4, 2013 at 4:28 am

    Not to be a killjoy but Microsoft themselves have officially distanced themselves from the Microsoft Security Essentials product. I would probably get something a little more supported and effective.

    http://www.pcpro.co.uk/news/security/384394/microsoft-security-essentials-is-designed-to-be-bottom-of-the-antivirus-rankings

    • TechnoAngina
      November 4, 2013 at 4:40 pm

      They have to say that otherwise they risk having problems with vendors and antitrust. Most antivirus products build off of the library that Microsoft shares out. The product itself is heavily involved in other extremely lucrative parts of their offerings so it's unlikely that they will discount it too much. Specifically the 0 days are where they tend to do the worst, but unless you've gone out of your way to remove the protections inherent in the Win7 and above OS you really have a lot more protection than people give it credit for.

      I'm a 'nix fanboy as much as the next guy, but I've really yet to find an area where the software has let me down and I've gone to some pretty seedy places researching things.

Leave a Reply

Your email address will not be published. Required fields are marked *