Search code examples
cmdevent-viewer

how to check event source is created or not in event viewer using cmd


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.


Solution

  • Reference WEVTUtil

    Retrieve information about event logs and publishers. Archive logs in a self-contained format, Enumerate the available logs, Install and uninstall event manifests, run queries, Exports events (from an event log, from a log file, or using a structured query) to a specified file, Clear event logs.

    Try the following:

    WEVTUtil enum-publishers | findstr yoursourcename
    

    where yoursourcename is the name of the event source your are looking for.