Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Windows Event Viewer Category Correspondence Table

I couldn't find the correspondence table between the value of the -Category argument (Int16) of Write-EventLog cmdlet and the category shown in Event Viewer from Microsoft.

I have run this command and viewed the result in the Event Viewer and Get-EventLog cmdlet.

0..32767 | ForEach-Object { Write-EventLog -LogName Application -Source Application -EventID $_ -EntryType Information -Category $_ -Message "SOME MESSAGE" }
Category English Japanese
0 None なし
1 Devices バイス
2 Disk ディスク
3 Printers プリンター
4 Services サービス
5 Shell シェル
6 System Event システム イベント
7 Network ネットワーク
8 (8) (8)
32767 (32767) (32767)

Note that the name of Category depends on the locale of the system. You will get Devices in English (Codepage 437) environment, while デバイス in Japanese (Codepage 932) environment.