Windows Server 2008 Event Trigger - Remote execution
Posted on 2010-11-19
I have two servers. On the first server I have an event trigger that is configured to run a simple batch file when a specified error appears in the application event log. For this example we'll say that our script performs a port query on TCP 1433 from Server1 our SQL server and prints the output to a text file. That part works well. In fact, we have this part working fine from both Server1 and Server2.
The issue that we're having that is making us perform this test is very intermittent. The issue might appear on Server1 and Server2 continues to function. We found out tonight that when this error occurred on Server1 it did not have connectivity on port 1433 to the SQL server. However, we weren't able to confirm if Server2 had connectivity to the SQL server. We can assume that it did from looking in its event logs but we need to be able to know for sure.
So, the question is - is there a way to have script on Server1 call and run a script (or batch file - or an event trigger) on Server2? Here is the flow that we'd like to achieve.
The event appears in the Server1 event logs which kicks off the event trigger. The event trigger on Server1 starts a portquery from Server1 to the SQL server (this part is accomplished). It also runs another script that will initiate the event trigger that is configured on Server2 - or it can call the batch file on Server2 directly so that it will run a portquery from Server2 to the SQL server.
I hope that I've made this clear... difficult to explain.