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/
</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
Post a Comment