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]
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 !!!!
Thanks JIM
It seems if you have Antivirus installed, then only this namespace is created.
🙂
Windows Security Center is not available on server operatingsystems, meaning that the rootSecurityCenter2 namespace also isn`t available.
Hello Aman,
AV is installed but I am experiencing the same issue.
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 ?