Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for login_log_av_win7.kix

(view source code of login_log_av_win7.kix as plain text)

  1. ; Get the current date in YYYYMMDD format
  2. $Today = "@YEAR" + Right( "0@MONTHNO", 2 ) + Right( "0@MDAYNO", 2 )
  3. ; Create the directory if it doesn't exist
  4. If Exist( "\\Server\Logs\$Today\*.*" ) = 0
  5. 	MD "\\Server\Logs\$Today"
  6. EndIf
  7.  
  8. ; Read the AV software status
  9. $objWMISvc = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/SecurityCenter2" )
  10. $colItems  = $objWMISvc.ExecQuery( "SELECT * FROM AntiVirusProduct", "WQL", 48 )
  11. For Each $objItem In $colItems
  12. 	$Msg = $objItem.displayName + "," + $objItem.timestamp
  13. Next
  14. ; Log the result
  15. If RedirectOutput( "\\Server\Logs\$Today\@USERID.log" ) = 0
  16. 	$Msg
  17. 	$RC = RedirectOutput( "" )
  18. EndIf

page last modified: 2024-02-26; loaded in 0.0126 seconds