Richard's profileRichard Siddaway's BlogPhotosBlogLists Tools Help

Blog


    November 10

    Security Essentials

     

    001
    002
    003
    004
    005
    006
    007
    008
    009
    010
    011
    012
    013
    014
    015
    016
    017
    018
    019
    020
    021
    022
    023
    #Requires -version 2.0
    ## wrapper functions for Microsoft Security Essentials
    $mse = "C:\Program Files\Microsoft Security Essentials\MpCmdRun.exe"

    function Start-Scan{
        param ([int]$type = 1)
        switch ($type){
        0   {   Write-Host "Starting Scan based on configuration"
                & $mse -scan -scantype 0
                break 
            }   
        1   {   Write-Host "Starting Quick Scan"
                & $mse -scan -scantype 1
                break 
            }
        2   {   Write-Host "Starting Full Scan"
                & $mse -scan -scantype 2
                break 
            }
       
       
        }
    }

     

    During my enforced break from posting in September & October PowerShell v2 was released for down level systems including Vista, Windows 2008, Windows 2003 and XP.  I’ve set up an XP machine to try it on and needed some AV. Not having licenses left for AVG which is my current AV product I decided to try Microsoft Security Essentials as well (its free which is always a good point for test machines)

    Security Essentials comes with a command line tool – but its not PowerShell. I can get two wins here by creating a module that wraps the mpcmdrun tool in PowerShell. It is also a good example of how to run a legacy command line tool within PowerShell and pass parameters to it.

    This function is the start – need to perform a scan – its easier to remember start-scan than the syntax of mpcmdrun.  I’ll can refine this by testing the range of the parameter and adding more functions.

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!2603.trak
    Weblogs that reference this entry
    • None