Advertisement
gocha

Get-EventLog example

May 13th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # PowerShell でイベントログを取得してファイルに出力するサンプル
  2. # 画面に出力したい場合は、最後の Out-File を外す
  3.  
  4. # イベントログ出力前のレジストリ記述等は下記を参考にする
  5. # http://www.syuhitu.org/other/eventlog/eventlog.html
  6.  
  7. Get-EventLog Application -Source AppName1, AppName2, ... -newest 5 -entrytype Error, Warning, Information | Format-Table -Auto -Wrap | Out-File a.log -width 4096 -encoding UTF8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement