Create New Eventlog via Powershell on Windows
You can create new eventlog via powershell on windows server or client. It doesnt matter client or server, method is same.
Some cases we need writing event log on the machie for application purpose or control something. In this short article i will demonstrate you how can you create New eventlog via Powershell.
Create New Eventlog via Powershell on Windows
Just before the creating eventlog, I want to show you there is no source which i havent been created on my eventlog viewer as name Test-Event.
I have two variables on below which describe Log source and Log message
$Logsource = will create new source on event viewer as Event sources
$Logmessage = The event log message i will create in the new eventlog
I have runned below powershell command.
1 2 3 4 5 6 7 |
#creating New EventLog $LogSource = “Test-Event” $LogMessage = “The spesific event has been created" New-EventLog -LogName Application -Source $LogSource Write-EventLog -LogName Application -Source $LogSource –EntryType Information -EventID 1 -Message $LogMessage |
There is no error on result
You can see the eventlog source and event log message has been created on windows server.
One thought on “Create New Eventlog via Powershell on Windows”
Bir yanıt yazın
Yorum yapabilmek için oturum açmalısınız.
[…] aslında daha önce değinmiştim. Not alma açısından ingilizce olarak paylaştığım linke buradan […]