Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am checking for antivirus name and version installed on my computer,although i have anti virus installed it is showing as "no av found"!!.
Whether i need to change name to my antivirus name or we have to give "name as %antivirus% " only???

What I have tried:

$avSoftware = get-wmiobject -class "Win32_Product" -namespace "root\cimv2" `
-computername "." -filter "Name like '%antivirus%'"

if ($avSoftware.Count -gt 0) {
foreach ($av in $avSoftware) {
write-host $p.Name $p.Version
}
} else {
write-host "No AV software found"
}
Posted
Updated 16-May-17 22:49pm
v3
Comments
Richard MacCutchan 17-May-17 4:57am    
This will only work if the AV products contain either of those strings in their name. So products such as McAfee, Norton Security, Windows Defender, Kaspersky etc., will never be found.

1 solution

You are searching for product names containing "antivirus". So you will not find software that does not contain that string. You might even find software that is not an AV software.

If you still want to use the Name property you have to search for strings that are used by the common AV products. I don't know these but some might for example contain "AV" instead:
SQL
Name LIKE '%antivirus%' OR Name LIKE '%AV%'

But AV products will register itself with Windows and can be queried from the Windows Security Center. See Security Center API[^] and Windows Security Center: Fooling WMI Consumers | OPSWAT Blog[^].

[EDIT]
Some useful links:
Auditing 32-Bit and 64-Bit Applications with PowerShell | Scripting content from Windows IT Pro[^]
Use PowerShell to Find Installed Software – Hey, Scripting Guy! Blog[^]
[/EDIT]
 
Share this answer
 
v2
Comments
Member 13007431 17-May-17 4:24am    
without using that name property also i am not getting, i have antivirus installed on my machine, please tell me how i can print my antivirus name and version
Jochen Arndt 17-May-17 4:32am    
I don't know which product you have installed. If it is not shown with the alternative method from my solution it is probably not registering itself.

Open the list of installed software in the control panel and check the name of your AV product. Then you can add a search term to get it listed.

If that does not help too you can try to check the list of services because AV software is usually running as a service.
Member 13007431 17-May-17 4:27am    
and also i cant see the security option in control panel
Jochen Arndt 17-May-17 4:35am    
?The links contain shell scripts to get the information. There is no need to open the control panel.
Member 13007431 17-May-17 4:44am    
trend micro office client i am using

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900