none
How can I create events for a new Event log? RRS feed

  • Question

  • I'm trying to create new events for a customer event log through PowerShell. I'm obviously messing seeming in the context; but I don't find much discussion on the New-WinEvent or New-Event cmdlets.

    I have a script that's going to write dozens of entries to a log and I don't want to either (1) clutter up the application log or (2) have other applications write entries to disrupt the flow of my script logging.  So I created a new event log but I'm having trouble creating the needed events.  I've tried:

    New-WinEvent -ProviderName scriptname.ps1 -id #### -Payload @("Workflow", "MESSAGE TEXT")

    New-WinEvent -ProviderName Microsoft-Windows-PowerShell -id #### -Paylog @("Worlkflow", "MessageText")

    New-WinEvent -ProviderName scriptname.ps -id #### "MESSAGE TEXT"

    None of those worked.   Where have I gone astray?

    • Moved by Bill_Stewart Friday, July 7, 2017 6:34 PM Abandoned
    Monday, May 22, 2017 6:18 PM

All replies

  • You can only create events for existing providers and logs. To create a new log and provider try searching for "custom event log"

    Help New-EventLog -full


    \_(ツ)_/


    • Edited by jrv Monday, May 22, 2017 8:10 PM
    Monday, May 22, 2017 8:09 PM