[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Write-Eventlog in PowerShell does not write to the log

Posted on 2014-08-13
4
Medium Priority
?
785 Views
Last Modified: 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.
0
Comment
Question by:Bob McCoy
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 2000 total points
ID: 40259111
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.
Did you try restarting the eventlog service or restarting the computer itself?
0
 
LVL 4

Author Comment

by:Bob McCoy
ID: 40259369
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.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 40259379
I had similar issues which cleared after reboot. Other than that I dont see any issues with commands/syntax..
0
 
LVL 4

Author Comment

by:Bob McCoy
ID: 40259613
Yep, reboot fixed it.  Events are now showing up.  Thanks.
0

Featured Post

New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question