- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Re: scripting question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2004 07:41 AM
тАО06-15-2004 07:41 AM
scripting question
I'm trying to write an ordinarily very simple script that will become a custom command to reboot a list of servers. I want to do some late-night unassisted reboots. It doesn't have to pull the list from the targets in SIM, it could read in a text file, but it would be nice to pull the list from SIM.
Here's the basic functionality of the code:
DO
Set CompConn = GetObject("winmgmts:{(RemoteShutdown)}//" & targetcomp & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
FOR EACH OS IN CompConn
OS.reboot()
NEXT
LOOP WHILE(boxes.atendofstream = false)
Can anyone give me some guidance as to how I might mod this simple function to run as a useful SIM custom command?
Thank you,
Seth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2004 07:44 AM
тАО06-15-2004 07:44 AM
Re: scripting question
FOR EACH box IN somecomputerlist
Set CompConn = GetObject("winmgmts:{(RemoteShutdown)}//" & targetcomp & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
FOR EACH OS IN CompConn
OS.reboot()
NEXT
NEXT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2004 01:00 AM
тАО06-16-2004 01:00 AM
Re: scripting question
I am attaching a script that will provide the functionality of reading through a list of computers and either reboot, logoff, or shut them down.
Now for the integration into SIM we might see if one of the HP guys that monitor this newsgroup might have some ideas.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2004 01:45 AM
тАО06-16-2004 01:45 AM
Re: scripting question
My hope is that I can make this reboot server script work just like the identify systems tool in SIM, for example. To do that I need to understand how SIM interacts with my script.
If I run a custom command on server1, server2, and server3, how do I access that list of target servers in the script that the command executes? How do I report the results back to SIM? When I run the command on a list of servers, does it run the script locally on each server, or does it just execute in the location that I drop the script on my CMS? Basically, I'd like to know what the heck happens when I run a custom command and how I can harness those happenings. So far my experimentation hasn't been getting me anywhere.
If anyone has a script that is integrated similarly, that would probably be a less time-consuming alternative to explaining the inner workings of SIM to me. I realize this is a rather complex question, and very much appreciate any assistance.
Seth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2004 05:48 AM
тАО12-08-2004 05:48 AM
Re: scripting question
I have had success by creating a custom command that launches my vb scripts when certain events come in. My script does not recieve a list of servers from SIM but it does recieve all of the variables that are stored in an event. SIM uses the variable DEVICENAME for the computername. I incorporate this into my script like this:
Set objShell = WScript.CreateObject("WScript.Shell")
strComputer = objShell.ExpandEnvironmentStrings("%DEVICENAME%")
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2006 07:48 AM
тАО02-02-2006 07:48 AM