How to pass Event info to task attached to it
I am trying to run a script every time a print event happens on a Windows 2008 R2 print server (Event ID 307 from PrintService?). I have a script that, given the information in the event, will parse it and make an entry on a MySQL database, but I have not found a way to transfer the details of the event to the script/task attached to it. Is this possible? I have found the parameters list in the Details view of the event, and I was hoping there was a way to export these to the tasks attached to the event; otherwise, exporting the text of the event would be enough as I can extract the info I need from it. Thank you for your help. FD
September 28th, 2010 9:30am

Hi, take a look at listing 3 in this msdn article http://msdn.microsoft.com/en-us/library/ms974579.aspx HTHEdoardo Benussi - Microsoft MVP Management Infrastructure - Systems Administration https://mvp.support.microsoft.com/Profile/Benussi Windows Server Italian Forum Moderator edo[at]mvps[dot]org
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2010 10:38am

Yes, but the critical point is how to pass a reference of the actual event that started the task to the script; otherwise the script has to find the event by trawling through the Event Logs and if two of them happen close to each other, they might be confused. FD
September 28th, 2010 11:19am

wbemObject.RecordNumber is not enough as reference ?Edoardo Benussi - Microsoft MVP Management Infrastructure - Systems Administration https://mvp.support.microsoft.com/Profile/Benussi Windows Server Italian Forum Moderator edo[at]mvps[dot]org
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2010 11:30am

? OK, I set up a task attached to the 307 events in PrintService. This task starts a VBScript which will take the text message from the event and parse it. How do I reference the text message from the precise event that triggered the task from inside the script (or through an argument to it)? FD
September 28th, 2010 11:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics