Task Scheduler - Available Arguments

Tony 1 Reputation point
2022-10-14T09:43:51.827+00:00

I have a Powershell script running on an event with the Task Scheduler and it works well, but I would like to get some of the information from the event to pass into the Powershell script. I cannot seem to find a list of available arguments I can pass in and find it hard to believe there are none?

For example I'd like to pass in the following:

event id
event message
event date/time

Anyone have any idea how to get these passed in as additional arguments?

Windows for business Windows Server User experience PowerShell
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2022-10-14T12:16:21.307+00:00
    0 comments No comments

  2. Limitless Technology 44,746 Reputation points
    2022-10-19T07:28:30.72+00:00

    Hello there,

    It seems like we cannot get the list of arguments in any official Microsft Blogs. To pass on additional arguments you can check the below articles which might help in getting some insights.

    Windows Task Scheduler w/ Multiple Arguments https://learn.microsoft.com/en-us/answers/questions/564326/windows-task-scheduler-w-multiple-arguments.html

    Scheduled Task - Trigerred by Event - Getting data into the scripts as parameters https://social.technet.microsoft.com/Forums/en-US/382b9023-01a9-4131-b2f2-8560b593bc3f/scheduled-task-trigerred-by-event-getting-data-into-the-scripts-as-parameters-question?forum=winserverpowershell

    ------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.