Write-Eventlog in PowerShell does not write to the log
Posted on 2014-08-13
I had run "new-eventlog -log REI -source Status" to create a new event log on a server (Win 2008 R2). I later decided to put my events in the Application log. So I deleted the REI log from the EventVwr.msc. And then entered "new-eventlog -log Application -source REI" to created the appropriate source. The only problem is that "Write-EventLog -log Application -source REI -Id 1001 -Message "Test Message"" doesn't create an event I can see.
I created an additional source called FOO and it seems to work OK. I can "Remove-Eventlog -Source REI" OK and trying to write to it indeed produces an error. Add it back, OK; but no events show up.
There seems to be some artifact left around from the previous creation of the REI log. I don't have this issue on other systems where I had not done that.
Looking for a clue as to what else might need to be cleaned up.