Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Windows Server 2008 Event Trigger - Remote execution

Posted on 2010-11-19
6
902 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

840 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