From: admin@lists.myITforum.com [mailto:admin@lists.myITforum.com] On Behalf Of Jeremy D. Pavleck
Sent: Thursday, February 26, 2009 7:06 PM
To: msmom@lists.myitforum.com
Subject: Re: [msmom] running a powershell script from the RMS server

You can run it from the RMS, but you have to scope the script to it, and then use the script itself to look for the servers (By querying the command shell for the computers in that group if it's dynamic, something with get-remotelymanagedcomputer, get-monitoringclass to grab the group, etc etc. I'll have to see if I can figure that one out - then use that array of computers to run your command against
-------------------------------------------
Jeremy D Pavleck
http://www.Pavleck.NET - OpsMgr, Powershell, monitoring and more!
http://www.Pavleck.COM - Random stuff. Probably not even up.
http://OpsMgr.Wik.Is - The Operations Manager Wiki!

"The fastest way to succeed is to look as if you`re playing by somebody else`s rules, while quietly playing by your own."
--Michael Korda

On Thu, Feb 26, 2009 at 2:22 PM, Froese, Ethan <FroeseE@missouri.edu> wrote:

I’m a bit confused on what happens when I run a powershell script on the RMS server which is targeting other servers. Here is how I think it works – correct me if I am wrong.

 

1.       I create a  group and populate the servers I want to target within that group      

2.       I create a Timed Command Rule “Execute a command” and set the management pack.

3.       I set the Rule target to something really generic like ‘Windows Server”

4.       I disable the rule as I plan to use an override for the group in step 1.

5.       I set the schedule to run during the days I want by selecting the “Base on fixed weekly schedule”

6.       I set the command line to C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe for the “full path to file” and -Command "&amp;file.ps1" for the “parameters”

7.       I then set an override for the group created in step 1.

 

 

 

My question is – does the above powershell script  run on the RMS server or does it run on the targeted servers in step one? If it runs on the targeted servers in the group created in step 1, it stands to reason that powershell needs to be installed on those targeted servers and the script needs to live on those servers as well.

 

It also stands to reason that Opsmanager is may not be the best  way to schedule a powershell script that is not event/alert driven. The powershell script I created monitors the state of a particular service on clustered server and lets the owner know every day via an email what clustered node is controlling the service.  Scheduled task seems a better solution in this case.

 

Thoughts?

 

Thanks

 

Ethan Froese

University of Missouri


==============
Missed an email? Check out the list archive:
http://myitforum.com/cs2/blogs/momlist/



==============
Missed an email? Check out the list archive:
http://myitforum.com/cs2/blogs/momlist/

Trackbacks

No Trackbacks

Comments

No Comments