Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Scheduler passing arguments to script

Status
Not open for further replies.

pud1974

IS-IT--Management
Mar 31, 2010
1
GB
Hi all,

First of all, thanks for reading. I'm trying to capture a certain event within Windows
Server 2008 and fire off a script, passing a variable to that script.

The event I'm trying to catch is user creation in Active Directory. When a user is created a script is invoked and the username of the newly created user is passed as an argument to the script.

This is what I have in my custom event filter:

<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">*[System[(EventID=4722)] and EventData[(Data[@Name="TargetUserName"])]]</Select>
</Query>
</QueryList>

I have "start a program" selected in the Actions which will start my script and I have "TargetUserName" defined in the "Add arguments" textbox.

I must be doing something wrong as my script is not receiving any argument at all. (I have of coursed checked my script by manually running it and it all works fine).

Any help would be very much appreciated. Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top