Link to home
Start Free TrialLog in
Avatar of Bob McCoy
Bob McCoyFlag for United States of America

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.
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob McCoy

ASKER

It's a production server.  The event log service can't be restarted since it's a dependent service.  I've scheduled downtime at 1730 CDT to reboot the server.  Will follow-up after.
I had similar issues which cleared after reboot. Other than that I dont see any issues with commands/syntax..
Yep, reboot fixed it.  Events are now showing up.  Thanks.