Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Through PowerShell, I am attempting to create a new event log and write a test entry to it, but it is not showing up the Event Viewer. This is the command I'm using to create a new event log:

new-eventlog -logname TestLog -source TestLog

And to write a new event to it:

write-eventlog TestLog -source TestLog -eventid 12345 -message "Test message"

After running the first command, there is no "TestLog" log in the event viewer anywhere, and I would expect it to show up in the Applications and Services Logs section. After running the second command, same result. However, I am seeing a registry key for the log at HKLM\SYSTEM\services\eventlog\TestLog. Just not seeing anything in the event viewer.

So, 2 questions: When should I be seeing the event log? After it gets created or after I write the first event to it? And, more importantly, why am I not seeing it at all?

I'm using Windows Server 2008R2, and am logged in and running the PS as an administrator.


share|improve this question
Are you refreshing the eventvwr.msc after this? I copied/pasted your commands and it worked as expected. Right-click the "Applications and Services Logs" container and select "Refresh". – jscott Dec 13 '12 at 20:12
Yes, I have refreshed many times. There has to be something I'm missing... – Mega Matt Dec 13 '12 at 20:15
@MegaMatt - are you running Powershell as an admin when creating the event source? I've had a lot of silent powershell failures without doing so. – Tim Brigham Dec 13 '12 at 20:22
Yes, running as an admin – Mega Matt Dec 13 '12 at 20:26
up vote 6 down vote accepted

Terrible reason: I needed to close the Event Viewer and re-open. That's completely insane. Thanks for help.

share|improve this answer
Odd, I guess your refresh was misbehaving. :) Glad you resolved this, please be sure to accept your answer when you are able. – jscott Dec 14 '12 at 0:45
I will second the "refresh" not being sufficient when creating a new log. Reload the viewer. – Jefferey Cave Jul 22 '15 at 14:42
Thank you...what a weird frustrating quirk. – Mark Mascolino May 19 at 14:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.