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

Generating Event ID 91, 44 with CA (In Event Viewer with source as Certsvc)

Group policy default policy cannot be edited because network name not found

Problem when changing update source