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]
please if you can do a tutorial to explain more, I nedd this solution
ReplyDeleteA very nice piece of scripting indeed. Can this be done from a list of computers?
ReplyDeleteA very nice piece of scripting indeed. Can this be done from a list of computers?
ReplyDeletePlease help me in getting the similar results for 2003 and 2008 servers
ReplyDeletePlease help me in getting the similar results for 2003 and 2008 servers
ReplyDeleteforeach ($item in $computerlist)
ReplyDelete{
Get-AntivirusName -computername $item.name
}
But there is a problem: Get-WmiObject : Invalid namespace "root\SecurityCenter2"
ReplyDelete