(view source code of login_log_av.bat.vbs as plain text)
' Query the AV status
Set objWMISvc = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/SecurityCenter" )
Set colItems = objWMISvc.ExecQuery( "SELECT * FROM AntiVirusProduct" )
For Each objItem in colItems
With objItem
strMsg = .displayName & "," & .versionNumber
If .onAccessScanningEnabled Then
strMsg = strMsg & ",TRUE,"
Else
strMsg = strMsg & ",FALSE,"
End If
If .productUptoDate Then
strMsg = strMsg & "TRUE"
Else
strMsg = strMsg & "FALSE"
End If
End With
Next
Set colItems = Nothing
Set objWMISvc = Nothing
' Log the result; variable 'strLog' and constant 'ForAppending' need to be set before
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
Set objLog = objFSO.OpenTextFile( strLog, ForAppending, True, TristateFalse )
objLog.WriteLine strMsg
objLog.Close
Set objLog = Nothing
Set objFSO = Nothing
page last modified: 2023-03-10