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.
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]