Maintenance Mode Scheduled Task for Ops Mgr 2007
Neale has addressed the challenge of putting groups of agent-managed nodes into maintenance mode via a PowerShell script, which could easily be run as a scheduled task.
Check it out here:
http://systemcenterforum.org/wp-content/uploads/CmdSchedMaint.zip
June 11th, 2007 at 11:07 pm
Hi,
Is it possible to put a sub component into maintenance? Not the whole server
Cheers
Sean
June 24th, 2007 at 3:09 pm
You bet. Find how HERE.
http://systemcenterforum.org/om-2007-scheduling-maintenance-for-an-object/
August 24th, 2007 at 1:29 pm
I just downloaded the zip-file from the link above and you’re really filling some hole here. However, I’m not really too experienced with scripting and maybe someone can help me with my question. I understand how to schedule the script with a normal scheduling program. However I’d like to have the whole thing in one place, meaning to use the scheduling function of Operations Manager itself (with the goal of course, that I can put it in the firm’s MP and as such it can be exported together with all the corresponding restart tasks I implemented in the RMS).
I know how to run scheduled scripts (VBS) on agents and this all works fine. However I didn’t manage yet to run the Power Shell-Script on the RMS.
I’m not sure if I can schedule PS-scripts (I doubt this is the problem) or maybe I’m targeting the wrong entity. As I can’t target the Agent on a Management Server, I tried all different kinds of entities and it didn’t seem to work.
I’d appreciate any help! Thanks!
November 30th, 2007 at 1:13 pm
The scritp works fantastic except if run this from a CMD file.
It seems that apostrophes and minus signes are not passed correctly.
How could solve this?
Thanks for your help!
WG.
April 4th, 2008 at 8:17 am
[...] The script: systemcenterforum.org/maintenance-mode-scheduled-task-for-ops-mgr-2007/ [...]
September 3rd, 2008 at 4:37 pm
I run the script with this parameters:
Powershell.exe .\groupschedmaint.ps1 -rootMS:’rootms.domain.com’ -groupname:’mygroup’ -timelenght:15 -timetype:’minutes’ -cmdreason:’plannedapplicationmaintenance’ -cmdComment:’scheduled Maintenance test’
And the exit of the command is:
PathName :
ManagementGroup : mymg
ManagementServerName : rootms.domain.com
Drives :
OpsMgr 2007 PSSnapin initialized!
The group mygroup is not in maintenance mode.
Please review command line parameters.
help me please!!!
thanks