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

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS