PowerShell

PowerShell Script : Find the name of Installed Antivirus on local or remote laptop.

Do you ever want to know what antivirus installed on remote laptop, or does remote system has a antivirus or not, knowing this is  always a pain, normally you have to call user and ask them,.

Today i have found a cool namespace named ““root\SecurityCenter2” ”  and this name space has a class “AntiVirusProduct ”, you just need to query that class and it will show you the name { and few more info}  of the antivirus installed.

Download Link : http://gallery.technet.microsoft.com/Get-The-Name-of-Installed-b10fd073 

You can download a little script { if you like } from the above link and when i run it, you can see that it is showing me the name of antivirus installed on my laptop.

23-10-2013 18-14-35

You can run the above script on remote laptop too.

function Get-AntivirusName {

 

[cmdletBinding()]   

param (

[string]$ComputerName = “$env:computername” ,

$Credential

)

 

 

       BEGIN

              {

                     # Setting WMI query in a variable

              $wmiQuery = “SELECT * FROM AntiVirusProduct”

 

              }

 

 

       PROCESS

              {

                     # doing getting wmi

               

                     $AntivirusProduct = Get-WmiObject -Namespace “root\SecurityCenter2” -Query $wmiQuery  @psboundparameters # -ErrorVariable myError -ErrorAction ‘SilentlyContinue’         

            Write-host $AntivirusProduct.displayName -ForegroundColor Cyan

 

              }

 

       END {

 

              }

} #end  of the function

 

Thanks for reading.

Aman Dhally

Tested on : Windows7 [64 bit]

 
clip_image001 clip_image002 clip_image003 clip_image005  clip_image007

5 thoughts on “PowerShell Script : Find the name of Installed Antivirus on local or remote laptop.

  1. Tested on windows 8 works fine… But I’m tested on Windows Server 2008 R2 too and doesn’t work

    Get-WmiObject : Invalid namespace “root\SecurityCenter2” 😛

    great work !!!!

    1. Thanks JIM

      It seems if you have Antivirus installed, then only this namespace is created.

      🙂

      1. Windows Security Center is not available on server operatingsystems, meaning that the rootSecurityCenter2 namespace also isn`t available.

    1. Ok So Found out that “root\SecurityCenter2” and “root\SecurityCenter” classes are not available in server OS. So what can we do in order to find out the AV installed on Server OS ?

Comments are closed.