Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for login_log_av_win7.ps

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

  1. $Today = Get-Date -Format 'yyyyMMdd'
  2. # Append AV program name(s) and timestamp(s) to log file
  3. $AV1 = ( Get-WmiObject -Class AntiVirusProduct -Namespace 'root\SecurityCenter2' )
  4. $AV2 = ( $AV1 | Format-Table -Property displayName,timestamp )
  5. $AV2 | Out-File -FilePath "\\Server\Logs\$Today\$Env:UserName.log" -Encoding ASCII -Append
  6. # The 3 lines above may be joined into a single line

page last modified: 2024-04-16; loaded in 0.0201 seconds