Jan
29
Write to EventLog using PowerShell
Thursday, 29. January 2009 15:43
I wanted to use a custom event log with a custom source. This can be done like this:
[system.diagnostics.Eventlog]::CreateEventSource(“MyOwnSource”, “MyEventLog”)
[system.diagnostics.eventlog]::WriteEntry(“MyOwnSource”,”Hello World”,[system.diagnostics.eventlogentrytype]::Error)
Category:EventLog, PowerShell | Comments (2) | Author: Dennis Damen