I was created an event source in event viewer using cmd but now I want check before creating event source into event viewer that event source already created or not using cmd.
how to check event source is created or not in event viewer using cmd
1.5k views Asked by swapnil At
3
There are 3 answers
0
On
EVENTCREATE [/S system [/U username [/P [password]]]] /ID eventid
[/L logname] [/SO srcname] /T type /D description
Description: This command line tool enables an administrator to create a custom event ID and message in a specified event log.
For boot time checking using source name for any Windows version (as it varies).
wmic /append:"%userprofile%\desktop\DiskEvents.html" PATH Win32_NTLogEvent where (sourcename='Autocheck' or sourcename='Winlogon' or sourcename='WinInit') get /format:HForm
0
On
Hi i'm not sure if this is feasable with cmd but you can test it with powershell (integrated in Windows since Windows 7?)
write-eventlog -logname Application -source TestApp -eventID 3001 -entrytype Information -message "MyApp added a user-requested feature to the display." -category 1 -rawdata 10,20
if it's not registered you'll an error something like this "write-eventlog : The source name "TestApp" does not exist on computer "localhost"."
hope this will help you.
regards
Reference WEVTUtil
Try the following:
where
yoursourcename
is the name of the event source your are looking for.