Username: Password:
 | Register
Home
System Center Forum
  • News
  • Articles
  • How To Guides
  • Downloads
  • Frequently Asked Questions
  • Links
  • Events
  • Contact Us

Tip: Scheduling Maint Mode for objects classes other than agents



  Posted by: Pete
  Categories: News, Operations Manager 2007, Powershell

We published  a nice Powershell sample for putting a specific object (regardless of object class) awhile back (check it out HERE). Here’s a good example of how to put an website monitor into maintenance targeting the object display name.

  • Replace “Web Application Name” with the Display Name with that on your monitor.

  • Replace the 60 with the number of minutes you’d like to throw the object into maintenance.

 $Now = get-date

$WebAppObject = get-monitoringobject | where {$_.DisplayName –eq “Web Application Name”}new-maintenancewindow -starttime $Now -endtime $Now.addminutes(60)
–comment “Nightly shutdown” –monitoringobject $WebAppObject

Wrap that up with the connection string to connect to your management group and save as a .ps1 file and you can schedule it in a task to run nightly!

Thanks to Graham for posting the additional example on the original post.

Update your MOM skills to Operations Manager 2007 at the Operations Manager 2007 Bootcamp!

Check the 2008 Bootcamp Schedule and request pricing and availability HERE.

One Response to “Tip: Scheduling Maint Mode for objects classes other than agents”

  1. System Center Forum - Update: Collection of Maintenance Mode Scripts, Utilities and MPs for Opsmgr and Essentials 2007 Says:

    […] See the code snippet for maintenance mode for any object class HERE or HERE. […]

Leave a Reply

You must be logged in to post a comment.


Privacy Policy | Terms of Use | © 2005-2007 Pete Zerger