Bob McCoy
asked on
Write-Eventlog in PowerShell does not write to the log
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I had similar issues which cleared after reboot. Other than that I dont see any issues with commands/syntax..
ASKER
Yep, reboot fixed it. Events are now showing up. Thanks.
ASKER