Scheduled Task - Trigerred by Event - Getting data into the scripts as parameters...- Question


hello - have event id - let password reset (4720 or other). have attached task event, whenever admin resetting password task can trigger power-shell script. - question: how pass data event using task scheduler power-shell script? help...

just in case 1 in future looking this:

1. export xml task

2. add xml:

<valuequeries>
        <value name='targetusername'>event/eventdata/data[@name="targetusername"]</value>
    </valuequeries> 

3. add script being run task:

param(
$targetusername
)

and $targetusername

4. add task (parameter box):

c:\script.ps1 -targetusername $(targetusername)

this how should be... in case has questions - reply. works....


thanks!



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Azure MFA with Azure AD and RDS

Failed to setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html