How to schedule Maintenance Mode in SCOM 2012?

Hi
How do I schedule Maintenance Mode in SCOM 2012? Do we have any tool for 2012 like we had with 2007?
Regards,
Akhilesh
Thanks, Akhilesh

Yep - to add a calendar takes some extra steps:
E.g. 
1) Create a database which includes a table to store information such as:
- target for maintenance mode
- scheduled time for maintenance mode
- Comments
- Duration
- Reason
2) The Service Request fires off an Orchestrator runbook that stores this information in the database
3) Another Runbook that runs frequently that checks the database to see if it should kick off maintenance mode.
It isn't any easy solution for maintenance mode. It works better for more simplistic scheduling e.g. we do implement this kind of logic for environment refreshes and backups where we use the SM Portal and Orchestrator to log a date and then have another
runbook that runs at 2am every day to check if it should execute a backup \ refresh.  
Cheers
Graham
Regards Graham New System Center 2012 Blog! -
http://www.systemcentersolutions.co.uk
View OpsMgr tips and tricks at
http://systemcentersolutions.wordpress.com/

Similar Messages

  • How to place multiple servers in Maintenance Mode in SCOM 2012

    Hi All,
    I am trying to place multiple servers in Maintenance Mode in SCOM 2012 but i could not find any PoSh script or any other solution to do it.
    Could someone help me please?
    Regards, Srini

    Hi,
    Please find the script.
    need to have access and you can provide list of servers in text file.
     param([int32]$TimeMin, [string]$Reason, [string]$Comment)
                    $api = new-object -comObject 'MOM.ScriptAPI'
                    Import-Module operationsmanager
                    New-SCOMManagementGroupConnection
                    $Servers = Get-Content "ServerList.txt"
                    $Time = (Get-Date).Addminutes($TimeMin)
                    Foreach ($Server in $Servers)
                                    #Get Computer instance
                                    $ComputerClass = Get-SCOMClass -Name Microsoft.Windows.Computer
                                    $ComputerClassInstance = Get-SCOMClassInstance  -Class $ComputerClass | Where {$_.DisplayName -eq $Server}
                                    If ($ComputerClassInstance.InMaintenanceMode -eq $true)
                                    #Write-Host $Server " is in maintenance mode"
                                    Write-Host $Server" already under Maintenance Mode or not accessible by SCOM, skipped from script execution" -foregroundcolor "red"
                                    $api.LogScriptEvent('MaintenanceModeScript.ps1', 201, 1, "$Server already found under MM, skipped from script execution")
                                    Else
                                    #Write-Host $Server " is NOT in maintenance mode, attempting to put in MM......."
                                    If ($ComputerClassInstance -ne $Null)
                                                    $HealthServiceWatcherClass = Get-SCOMClass -name:Microsoft.SystemCenter.HealthServiceWatcher
                                                    #Get Health Service Watcher Class instance of the server
                                                    $HSWClass = Get-SCOMClass -Name Microsoft.SystemCenter.HealthServiceWatcher
                                                    $HSWClassIns = Get-SCOMClassInstance  -Class $HSWClass | Where {$_.DisplayName -eq $Server}
                                                    #Starting the maintenance mode
                                                    Start-SCOMMaintenanceMode -Instance $HSWClassIns -EndTime $Time -Reason $Reason -Comment
    $Comment
                                                    Start-SCOMMaintenanceMode -Instance $ComputerClassInstance -EndTime $Time  -Reason $Reason
    -Comment $Comment
                                                    Write-Host "Health Service Watcher and Agent server "$Server " kept in maintenance
    mode for $TimeMin minutes"  -foregroundcolor "green"
                                                    $api.LogScriptEvent('MaintenanceModeScript.ps1', 200, 0, "$Server kept in maintenance
    mode for $TimeMin minutes")
                                    Else
                                                    Write-Host $Server" not found in Domain" -foregroundcolor "red"
                                                    $api.LogScriptEvent('MaintenanceModeScript.ps1', 202, 1, "$Server not found in domain")
    Regards
    sridhar v

  • Put servers in Maintenance Mode in SCOM 2012

    Hi,
    When we put a server in maintenance mode in SCOM 2012 it asks for only the end time. How can we specify the start time for maintenance mode.
    Thanks

    You can specify the start time for maintenance mode by schedule Maintenance mode.
    For how to create schedule for maintenance mode, you can refer below link
    http://support.microsoft.com/kb/2704170/en-us
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • How to create a group in SCOM 2012 R2 based on SCCM Collection?

    Is there a way to create a group in SCOM 2012 R2 based on sccm collection? I am planning to use that group for maintenance mode.
    Thanks, Samer

    Hi,
    I think you could query all the collectin members from SCCM database then use powershell to add them to a specific OU.
    How to Create Groups in Operations Manager
    http://technet.microsoft.com/en-us/library/hh298605.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Script for putting servers under Maintiance mode in SCOM 2012

    Hi,
    Could someone pls help me out for putting windows servers under maintiance mode by using poweshell script. We have nearly 300 windows servers and needs to be put in maintiance mode as there was a scheduled activity. We are using scom2012 server.  I
    have gone through other sites and see some poweshell scripts. As am not good in scripting, pls help me out
    Regards, Rajeev Parambil

    Hi,
    Hope the below links can be useful for you:
    SCOM maintenance mode setting for list of servers
    http://blogs.technet.com/b/markmanty/archive/2012/05/14/scom-maintenance-mode-setting-for-list-of-servers.aspx
    Put Agents in Maintenance Mode using Remoting Powershell
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/2171ef8f-4a7f-4ec0-8d35-d5a903884dff/put-agents-in-maintenance-mode-using-remoting-powershell-?forum=operationsmanagergeneral
    Regards,
    Yan Li
    Regards, Yan Li

  • SQL Query for maintenance mode in SCOM

    Hi all
    I was wondering if I can find a query about this request:
    - Found all the Servers that were restart without the maintenance mode were actived ?
    It's to make a Report To include in Reporting Services.
    sorry for my English :)
    Thank you very much and have a good day

    Your question seems related to SCOM. SCOM may use SQL Server, but to answer the question, I guess one needs to know SCOM, so maybe you should try a forum for that product? I found
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/home?forum=operationsmanagergeneral
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to enable maintenance mode on SMD?

    I have poked around in the SMD but failed to find the spot to do it.
    Please help. Thanks!

    Hi,
    Follow this Diagnostics Administration > Managed Systems > Agent Administration and click on Enable maintenance mode button thats all.
    regards
    Naveen

  • SCCM 2012 Software Update Management for Windows Servers and how to automatic set SCOM maintenance mode?

    Hi,
    We planning to go one level higher to automat and have more dynamic Software Update Management for Windows Servers. We have SCCM 2012 R2, SCOM 2012 R2 and SCO 2012 R2.
    Our plan is to pur server in an AD-Group to get Update Schedule, from the servers will be importet to an Collection for Automatic Update and reboot. If I understand Everything right SCOM can't read AD-Group and put then in an Schedule maintenance mode. SCOM
    can read reg value as exempel.
    IS there any smar way to make the SCOM Maintenance Mode Schedule dynamic?
    I found this
    http://www.scom2k7.com/scom-2012-maintenance-mode-scheduler/?
    /SaiTech

    You could use Orchestrator to put the servers from a specific collection, or AD group, in maintenance mode in SCOM. For an example see:
    http://www.systemcentercentral.com/orchestrator-how-to-scom-maintenance-mode-for-windows-computers-in-an-sccm-collection/
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • SCOM 2012 - Use Powershell to put specific server and contained objects into Maintenance Mode

    I am still trying to develop what I thought was going to be an easy script, to put a specific server and all it's contained objects into maintenance mode in SCOM 2012.   Not a group, but just one specific server and all it's stuff.
    My script to START maintenance mode has two parameters:
    1.  The FQDN.  So for example: server1.contoso.com
    2.  The amount of minutes to put into maintenance mode
    Then it does the following to START maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $newEnd = ((Get-Date).AddMinutes($minutes))
    Start-SCOMMaintenanceMode -Instance $Instance -end $newEnd -Reason "PlannedOther" -Comment "Comments here"
    This seems to work from what I can tell.  I know that when you schedule maintenance mode manually in SCOM, there is an option to apply to "Selected objects and all their contained objects".  I do not know if that is occurring based on
    my code above.   But I think that is what I want to happen.   I just want all monitoring and alerting for the specified server to stop.   So if you think I need to change the above code so that it gets all the "contained
    objects" please let me know.
    The second part, which I know for a fact isn't fully working, is intended to stop maintenance mode for a server.
    My script to STOP maintenance mode has only one parameter:
    1.  The FQDN.  So for example: server1.contoso.com
    Then it does the following to STOP maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance
    If ($MMentry)
    #basically sends an end time of 1 minute from when the script is run
    $newEnd = ((Get-Date).AddMinutes(1))
    Set-SCOMMaintenanceMode -MaintenanceModeEntry $MMEntry -EndTime $NewEnd -Comment "Removing from Maintenance Mode"
    This part does seem to work partially.   It does remove the server from maintenance mode.  However, I suspect that it's not removing all the "contained objects" from maintenance mode because when I run the script to stop maintenance
    mode on a server, the little maintenance mode icon in SCOM does go away but the overall light for the server stays set to "Not Monitored".   It never turns back to the green checkbox and says "Healthy".   When I start
    and stop maintenance mode manually I can see that the green Healthy checkbox comes back.  But when I try to run my above code to do it via script, it stays at "Not Monitored" instead.
    Can someone help me out here?  Looking for answers to two questions:
    1.  Does my Start maintenance mode code look ok? Will that put a server and all it's contained objects into maintenance mode?
    2.  What do I need to hadd to my Stop maintenance mode code, so that it correctly stops maintenance mode on the server and all its objects and everything starts to be monitored again?
    Thanks in advance!  Please let me know if you need any more information in order to be able to help me!

    Hello, thanks for your response.  Unfortunately, it does not appear that the link you provided works.
    As far as not including "selected objects and all their contained objects" I am wondering if there is a way for me to tell for sure. One thing I found was that if I run this script and put the server into maintenance mode, then I go into
    SCOM and click on Edit Maintenance Mode for that server, it shows me the details.   It has some comment, and my selected reason, based on the code I posted above.   It also DOES have "selected objects and all their contained objects"
    selected at top.  So it seems to me like it is working correctly, and does contain all the objects.   If you think that 'Edit' screen would be inaccurate for some reason, please let me know.  Or if you know of a way for me to check and
    confirm, please let me know that as well.
    As for REMOVING it from maintenance mode, I did eventually find a line of code that I think works.  Here's what my code looks like now:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance If ($MMentry)
    $Instance.StopMaintenanceMode([DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);
    When I use the above code to STOP maintenance mode, the green checkmark does reappear for the server, and everything seems to be being monitored again.   Unlike before, where the maintenance mode icon would go away, but it would never change back
    to saying 'Monitored' again.  So I think that changing that one line to stop maintenance mode seems to have done the trick.
    So I guess my last concern now is just putting in maintenance mode initially, as I was talking about above.  If you still think the 'Edit Maintenance Mode' screen is not a good indicator of what my code does, please let me know.

  • Automatic Maintenance Mode SCOM 2012

    What I'm trying to do is get an alert based on a shutdown event to trigger a script that then puts the server into maintenance mode.  I've seen a few solutions to this for 2007, but this is the only one I've seen for 2012. 
    https://overcast.azurewebsites.net/2013/11/auto-maintenance-mode-with-scom-2012/
    Basically, an alert is set up to watch for the shutdown event, which then uses a command channel to execute the script.  The main significant part of that is the use of the ManagedEntityDisplayName parameter in the command channel to pass the server
    name to the script.  If I run the script from a command prompt and pass the FQDN of the server to it as a parameter, it works like a charm.  But when I use SCOM to run it through the command channel, the server never gets put into
    mm.  For troubleshooting, I had it write a couple things to a log file. 
    When I run it from the command prompt, the log file contains the hostname I'm passing it for the ManagedEntity parameter in line 4, and the Instance that is returned from line 6 and it all works.
    When I run it with the command channel in SCOM, it again writes out the ManagedEntity parameter as the hostname, so that part seems to work the same.  But the Instance is returned to the log file as an empty line and then of course the server doesn't
    go into MM.  So it seems like something is different between me passing the FQDN as a parameter from the command line, and the command channel passing the ManagedEntity parameter from SCOM.  Even though they both get written to the log file as the
    hostname of the server.  Any idea what I'm missing?
    Param($ManagedEntityDisplayName)
    $startTime = [DateTime]::Now
    $endTime = $startTime.AddMinutes(15)
    "Managed Entity is $managedentitydisplayname" |out-file log.txt
    import-module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $ManagedEntityDisplayName
    "Instance is $Instance" | Out-File log.txt -Append
    Start-SCOMMaintenanceMode -Instance $Instance -EndTime $endTime

    Hi 
    What version of Power shell are you using on your management server? The I suspect the issue might be that when you run it doesn't actually load "import-module
    OperationsManager" when scom runs it. So when you execute any scom command and save it into a variable it will always be empty.
    To test if this is the issue run this
    Param($ManagedEntityDisplayName)
    $startTime = [DateTime]::Now
    $endTime = $startTime.AddMinutes(15)
    "Managed Entity is $managedentitydisplayname" |out-file log.txt
    import-module OperationsManager
    $SCOMConnection = Get-SCOMManagementGroupConnection
    "Connection is $SCOMConnection" | Out-File log.txt -Append
    $SCOMAgent = Get-SCOMAgent -name $ManagedEntityDisplayName
    "SCOMAgent is $SCOMAgent" | Out-File log.txt -Append
    If you don't get anything for these variables looks like the Import module is the issue.
    I suggest the following:
    Adding the full file path location to the module (might just not be registered correctly)
    see: http://msdn.microsoft.com/en-us/library/dd878350(v=vs.85).aspx
    If the above doesn't fix the issue re installing the console might be needed
    see: http://thoughtsonopsmgr.blogspot.com.au/2013/02/om12-sp1-operations-manager-shell-fails.html
    What version of Power shell are you also running on your Management server/s? If you are running v4 you might also need to include credentials when making a connection to the management server:
    see: http://blogs.technet.com/b/robcost/archive/2008/05/01/powershell-tip-storing-and-using-password-credentials.aspx
    So your after you import the Operations manager module you need
    New-SCOMManagementGroupConnection -ComputerName "localhost" -Credential (Get-Credential WOODGROVE\Administrator)
    see: http://technet.microsoft.com/en-us/library/hh920188(v=sc.20).aspx
    Also how many management servers do you have? If you have more that 1 don't forget to place a copy of the script in the same location on each MS.
    Thanks Martin
    sustaslog.wordpress.com

  • Another SCOM Maintenance Mode query/advice...

    Hi,
    Just looking some advice on setting SCOM Maintenance Mode (using SCOM/SCO 2012R2)...
    I want to be able to set a server entirely into MaintMode, ie similar to choosing "Selected object AND ALL their contained objects" from SCOM console.
    I had asked similar question back in SCOM 2007/Opalis days, but the solution then (placing server and health server watchers separately into maintenance as per Anders blog http://contoso.se/blog/?p=2164 I'm not sure is appropriate now as I believe MaintMode
    is handled differently in 2012.
    I have seen some pretty complex solutions where using custom built DBs to hold MaintMode status etc.  Was hoping theres a neater/simpler soultion using the Orchestrator Activities these days.
    If not possible using Native Orchestrator then the fallback would be to try use powershell commandlet.  Looking at the Commandlet Examples if I used the following example solution, will that effectively put the server object (and all contained objects
    into maintenance which is what I'm trying to achieve.
    Windows PowerShell
    PS C:\> $Instance = Get-SCOMClassInstance -Name "Server01.Contoso.com"
    PS C:\> $Time = ((Get-Date).AddMinutes(10))
    PS C:\> Start-SCOMMaintenanceMode -Instance $Instance -EndTime $Time -Comment "Applyin
    Any advice to this recurring pain point of SCOM much appreciated.
    PS. Not sure if this post is better placed here or in SCOM/Powershell forum so can move if necessary...

    Hi Michael,
    thanks for your reply confirming the powershell command will work.
    I have actually just tried using the native Start Maintenance Mode Activity which actually seems to do as required - if the monitor selected is the relevant <servername> : Microsoft.Windows.Computer: <servername> object then it seems to put the
    entire server into maintenance.  I tested against a server which happened to also host SQL role, so when I placed in Maint via the runbook  I then stopped the SQL service and no alerts generated from SQL MP and I could see the spanner Icon against
    the server in relevant SQL node views aswell.
    I had though maybe that only windows MP stuff might be supressed - so again when I came across all the very complex solutions to apply Maint mode properly I wasnt sure if it was still relevant in 2012 (even though some of those solutions indicated for use
    on SCOM/SCO 2012?)
    Anyway if the simple solution work - as it appears to do so, then I'll run with that - unless someone can tell me why not?...
    Cheers

  • How to remove network devices through powershell? (scom 2012)

    Hi
    Could anyone says how to delete network device in SCOM 2012 through powershell?
    In 2007 we have Get-RemotelyManagedDevice.
    I have a big number network device in monitoring and now need delete some of them with specific filter, all switches.
    How to do it?
    Thanks
    Alex

    The devices were discovered by an old Management Server that was reinstalled.
    I finally got those devices out of my SCOM environment using this SQL query (just replace networkdevicename):
    UPDATE
    BaseManagedEntity
    SET
    isdeleted=1
    from
    BaseManagedEntity where
    BaseManagedEntityId in
    (select
    BaseManagedEntityId from
    BaseManagedEntity where
    displayname like
    '%networkdevicename%')

  • Can overrides from SCOM 2007 R2 be used in a new SCOM 2012 R2 installation?

    Hi All,
    I'm wondering if we can "easily" use our overrides/configuration from our current SCOM 2007 R2 implementation and use them in a new SCOM
    2012 R2 environment that we plan on standing up.  We are using SCOM to monitor approx. 400 servers (physical and virtual).
    We have been using 2007 R2 for a few years and we'd like to start using 2012 R2.  Instead of using the update path (2007 R2 to 2012
    to 2012 SP1 to 2012 R2), we are planning on setting up a new 2012 R2 environment and configuring our servers to start reporting to 2012 R2 (after it has been configured in such a way as to "mimic" our 2007 R2 environment).
    Ideally, we'd like to avoid going through the upgrade path.  (We'll leave our 2007 R2 environment running so that we can still access "historical
    data" until the new 2012 R2 environment has had a chance to build up its own "historical data".)
    So ... I was thinking we could export our overrides from 2007 R2 and import them into 2012 R2, but I'd like to verify that this approach makes
    sense.  We haven't done extensive customizations to 2007 R2 in terms of Distributed Applications or Management Pack Objects (although we have made some changes - which I guess we could manually configure in 2012 R2 to offer the same "experience").
    The following are some of the Management Packs that we are using in 2007 R2:
    Microsoft Windows Active Directory
    Active Directory Certificate Services
    EMC Storage Monitoring
    IBM Hardware
    Microsoft Exchange Server 2010
    McAfee
    Microsoft Forefront Server Protection 2010
    Microsoft Office SharePoint Server 2007
    Microsoft SQL Server
    Microsoft Windows DNS Server
    Microsoft Windows WINS
    Microsoft Windows Hyper-V
    Microsoft Windows Internet Information Services
     Microsoft Windows Server
    Microsoft Windows DHCP
    NetBackup Operations Manager
    Office Communications Server
    OpsLogix (BlackBerry)
    Service Level Dashboard for OpsMgr 2007 R2
    SolarWinds Orion
    Schedule Maintenance Mode
    Team Foundation Server 2010
    Virtual Machine Manager
    Microsoft Windows Cluster
    Operations Manager 2007 R2
    I appreciate all feedback and the sharing of you expertise.
    Thanks, Joe.

    As long as the base pack works and you wish to retain the customisation then you should be ok, there’s a good article
    here which explains how to perform the migration and some of implication/things to check.
    There will be complications if you’ve stored anything in the default mp but this is explained in the above article.

  • Maintenance Mode for Synthetic Transactions

    Hi,
    I'm looking for some guidance on how to apply Maintenance Mode to specific Synthetic Transactions correctly via Orchestrator.  My setup is Orchestrator 2012 R2 (and SCOM 2012 R2)
    I have an existing runbook which seems to run fine for placing a group of windows computers into maintenance mode - I 'think' it is ok, in 2012 there seems to be a single start maintenance mode activity targeting the windows computer object for this, wereas
    in 2007 there were 3 objects to target - the windows computer, health service and health service watcher.
    So now I'm trying to apply maintenance mode to specific Synthetic Transactions if possible - ie web application transaction monitors which run on 2 servers which are dedicated as watcher nodes for many other ST's aswell.  I had thought I had the issue
    solved when I created the runbook to set Maintenance Mode targeting the specific Web monitors - when I execute the runbook I can see the spanner maintenance icon appearing against all the 'Closed' alerts from these monitors in the scom console - so I assumed
    I was targeting the correct objects.
    I've scheduled the runbook to trigger for the time when I know these monitors create alerts (ie when the web services are restarted nightly on the particular server web server and the site will be down) however I am still seeing the alerts come in to the
    console (log history shows the runbook started OK on schedule) so I am wondering if there are other objects to put into maintenance - I assume I can't put the watcher node windows computer object into Maintenance Mode as this would be suspending the monitoring
    of other Stnthetic transactions running on the watcher node servers?...
    Any advice much appreciated...

    Sure, no worries.
    The authentication types can support 4 tyes of authentication from ntlm to basic.  If the site does not require authentication all the better, as the monitor will use less resourses and its easier to configure.
    R2 supports something like 10000 transactions to be monitored.
    Paulpaulk

  • Schedule Maintenance Events

    Hi All,
    How does Schedule Maintenance Events Work in Oracle Assets ( We are on 11.5.10.2)?
    Is there's a functionality to send an email alert on or before the scheduled date.
    Please let me know a source to refer this.
    Thanks and Regards,
    MPH
    Edited by: user11337190 on Nov 20, 2010 8:18 PM

    Do u think it is related to XI?
    It seems to be more about networking and maintenance related query.
    Regards,
    Prateek

Maybe you are looking for

  • Error: Sheduled Backup Job Problem

    Dear all. I've been getting a problem with a scheduled backup job through OEM since yesterday which I'm not able to find out why as it was working fine. When I access OEM I can see that I have a problem execution and when I investigate why it says "U

  • Usb device not recognised by windows 7 on hp pavillion dv5094ea

    Im having problems since ive updated my HP dv5094ea from windows xp up to windows 7, Since the upgrade my usb ports arent functioning, i keep getting an error bubble saying "Usb device not recognised" - device has malfunctioned ive tried several trou

  • Firmware Bundled in 10.4.6

    I'm getting a "This computer does not need this update" message when trying to apply the firmware update. I did not install it. Was it burried in the 10.4.6 update for Intel? If this question has already been asked elsewhere, I appologize to those wh

  • Prototype / Extend a TextInput()

    Hi -- I would like to add some functionality to a TextInput but I am not yet familiar with working with objects in AS 3. I do understand object oriented programming and I am familiar with prototyping in Javascript but I'm not sure of the exact syntax

  • Printing accuracy help

    A little background first, I've printed 1000's of pictures on many different printers, calibrated monitors and worked with PS  for years. So I have a lot of experience. When I have a issue I usually work it by googling and trial and error. However, w