Show antivirus status
File
av.vbs (5 views)
This WMI script displays information about the currently installed antivirus product, and whether it is up-to-date. It can easily be adapted for a domain admin's use to produce a report on all the machines on a network.
' Script written by David Barrett
' Copyright 2009
' http://www.cedit.biz/
' This script is licensed under the Creative Commons
' Attribution 2.5 Licence
' http://creativecommons.org/licenses/by/2.5/
'
' You are free to use it for both personal and
' commercial purposes, so long as full attribution
' is given to the author (David Barrett).
'
' This notice must not be removed
'
'
strComputer = "." 'Can set to remote machine.
dim colItems, objItem
On Error Resume Next
Set oWMI = GetObject _
("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer _
& "\root\SecurityCenter")
strText=strText & vbCrLF & vbCrLf & "Antivirus Information" & vbCrLf
Set colItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
for each objItem in colItems
strText=strText & "companyName: " & objItem.companyName & vbCrLf
strText=strText & "displayName: " & objItem.displayName & vbCrLf
strText=strText & "instanceGuid: " & objItem.instanceGuid & vbCrLf
strText=strText & "onAccessScanningEnabled: "
strText=strText & objItem.onAccessScanningEnabled & vbCrLf
strText=strText & "productUptoDate: " & objItem.productUptoDate & vbCrLf
strText=strText & "versionNumber: " & objItem.versionNumber & vbCrLf
next
WScript.echo strText
