Solved

Windows Server 2008 Event Trigger - Remote execution

Posted on 2010-11-19
6
901 Views
Last Modified: 2012-05-10
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.

Thanks,
Lee
0
Comment
Question by:KLCrow
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:meradz
ID: 34177509
Just for clarification, are you looking to forward events from Server1 to Server2, or just looking to execute a remote command from Server1 so that it executes on Server2?

Both are possible.
0
 

Author Comment

by:KLCrow
ID: 34177541
The second.  I want to basically run a portquery command on Server2... from Server1
0
 

Author Comment

by:KLCrow
ID: 34177680
That is - the command should be run on server2 but initiated from server1.  Geesh this stuff isn't difficult but it sure isn't easy to explain it in writing.  :)
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 2

Accepted Solution

by:
meradz earned 500 total points
ID: 34178820
I understand. You will need to use winrs and winrm. It has been a while since I had to use them, but here goes:

On the system that you wish to execute commands received remotely, execute this command:
winrm quickconfig

Use winrs command from machine to initiate the remote command:
winrs -r:target command

Microsoft has changed the default ports used in one of their updates, so you may or may not run into issues.
0
 

Author Comment

by:KLCrow
ID: 34180268
Thanks for the help!  I'm in the process of switching from nights to days.  This is a high priority for us but I need a couple of days to adjust to the schedule.  It's nice - I'm switching shifts twice in 3 days this week to support folks.  I'll let you know as soon as I get a chance to work on it.
0
 

Author Closing Comment

by:KLCrow
ID: 34194675
Used the following article for further information:
http://www.windowsnetworking.com/articles_tutorials/How-Windows-Server-2008-WinRM-WinRS.html

Thanks!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question