Monthly Archives: December 2011

Create EventLogs using Powershell

Create container for logs:

New-EventLog -logname 'Event Log Name' -source 'logsourcename'

Note: Must be run in elevated powershell window

Command to create event log:

Write-EventLog -computername localhost -logName 'Event Log Name' -EventID 5000 -Message "Hello World!" -EntryType Information -source logsourcename

Finding newly created event log:
Open Server Manager

Expand Diagnostics

Expand Event Viewer

Expand Applications and Services Logs

Click on the container that you named using the -logName parameter
Your Logs should be in the right pane.