SCOM 2012 - Getting List of Objects in Maintenance Mode

Hi,
I want to create a group of all the objects that are in Maintenance / Unmonitored Mode at that particular moment. Whether it is possible to have it?
Regards,
Sajid

Hi,
Creating Groups in SCOM 2012 with PowerShell
http://blogs.msdn.com/b/rslaten/archive/2013/06/06/creating-groups-in-scom-2012-with-powershell.aspx
Modifying Explicit Group Membership in SCOM 2012 with PowerShell
http://blogs.msdn.com/b/rslaten/archive/2013/06/27/modifying-explicit-group-membership-in-scom-2012-with-powershell.aspx
With the second link, we use instancestoadd parameter to specify those objects that are in maintenancemode:
InstancesToAdd
Optional: GUIDs of the instances you want to add to the group. You can pass multiple by separating each with a  comma
Regards,
Yan Li
Regards, Yan Li

Similar Messages

  • 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.

  • SCOM 2012 Get Gray Management Servers With PowerShell

    Hi,
    I have SCOM 2012 R2.
    I want to get all the Management Servers that are in Gray state using powershell. How can I do that?
    I couldn't find anything good in the internet.
    The best I got was Get-SCOMManagementServer but when I tested it out - it still showed that my gateway's HealthState was "Success" even though it was gray.
    Thanks,
    Yakir.

    Hi,
    Check if this one helps
    Get-SCOMClass-name"Microsoft.SystemCenter.ManagementServer"|get-scomclassinstance|selectdisplayname,healthstate
    I dont what is your final objective, but check this link
    http://blogs.technet.com/b/jasonrydstrand/archive/2013/03/27/daily-scom-health-check-with-powershell.aspx

  • Func/BAPY to get list of objects from Material class

    Hi guys,
    I am looking for BAPI/FUNC to get list of material/objects if I know Class and Class type. In MM02 I am doing following: In selection of input I choose Materilas of Class there I write Class and Class type, and then there is icon FIND IN INITIAL CLASS after clicking that icon I get list of materials for entered class.
    Can you advise me which BAPI/Func do that or in which tables I can find this DATA.
    Thanks very much for any help.
    Zbynek

    Zbynek,
    Try using this BAPI....<b>BAPI_CLASS_SELECT_OBJECTS</b>
    Actually you can do this by directly going to tables....
    First using the class type and class number, go to KLAH tables... get the Int class no. (KLAH-CLINT). Using this go to KSSK table and use the KLAH-CLINT value in KSSK-CLINT and adda another condition like KSSK-MAFID = 'O'.
    Hope this helps...
    Please provide reward points if you find this reply helpful.
    Balaji

  • Using Powershell (or console) to find all objects in maintenance mode?

    Hi,
    I have stumbled across the fact that aside from a handful of servers that have been put into pretty much unlimited MM rather than fix them a previous admin has put loads of individual objects such as disk drives, network cards etc. in long MM.
    I am trying work out an easy way of seeing the server associated with the actual disk, card etc.. I am using -
    Get-SCOMMonitoringObject | where-object {$_.InMaintenanceMode -eq $true}
    This does list everything such as -
    Success                True        C:                                        
    Uninitialized          True        Local Area Connection                     
    Uninitialized          True        Memory
    but I am not sure how I then link that to an actual server so I can take it out of MM?
    I am guessing I could use PowerShell to take all monitors out of MM for instance but dont really want to do that
    thanks!

    Hi,
    More details about command Get-SCOMMaintenanceMode:
    http://technet.microsoft.com/en-us/library/hh920235(v=sc.20).aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • SCOM 2012 R2 Upgrade - Reporting goes to install mode instead of Upgrade

    Hi
    I have upgraded all scom managent servers succesfully, but when I try to run setup.exe on the SQL server it doesn't detect the existing SCOM 2012 SP1 Reporting installation and instead of Upgrade mode it goes into Install mode. Have anyone seen this
    before?
    Torboro

    Hi Torboro,
    Just a quick reviewal of the below settings. 
    Can you once check and see if SCOM 2012 / 2012 R2 wizard / program is showing in Add / remove programs
    of the reporting server.
    If yes can you  select uninstall / repair option and give next it will show the installed components
    and see if you get the reporting option there as per my screen shot below plz?
    Gautam.75801

  • SCOM 2012 Maintenance Mode PowerShell Script Problems

    I've seen other questions about this topic before, but none of them seem to address my specific problem, so I am starting a new thread.
    I am writing a script to put a single server (not a group) into maintenance mode.   Here is the command that it ultimately tries to call:
     Start-SCOMMaintenanceMode-Instance$Instance-EndTime$EndTime-Reason$Reason-Comment$Comment     
    So an exmaple would look like this:
    Start-SCOMMaintenanceMode -Instance "$Instance -EndTime "02/03/2014 15:26:00" -Reason "PlannedOther" -Comment "Testing Maintenance Mode"
    When my script tries to run this command, this is the error message that I get:
    Start-SCOMMaintenanceMode : Start time must be before end time for maintenance mode.
    Parameter name: startTime
    At C:\users\x036036\Desktop\Start-SCOMMaintenanceModeForServer.ps1:143 char:21
    +                     Start-SCOMMaintenanceMode -Instance $Instance -EndTime $EndT ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (Microsoft.Syste...anceModeCommand:StartSCMaintenanceModeCommand) [Start-SCOMMaintenance
       Mode], ArgumentOutOfRangeException
        + FullyQualifiedErrorId : ExecutionError,Microsoft.SystemCenter.OperationsManagerV10.Commands.StartSCMaintenanceModeCommand
    I've tried to look at Start-SCOMMaintenanceMode help online, but I don't see that "startTime" is a parameter.  So what is this error message talking about?  What am I missing?  

    Thanks for your help.   I didn't see your response until just now, but I have been playing around with this all since my last response.   I got it to work.  I wish I could pinpoint what exactly I changed to get it to work, but I
    feel like I've been changing so much stuff that I'm not sure any more.
    Just in case anyone finds it useful, here is the code.
    [CmdletBinding(SupportsShouldProcess=$true)]
    param
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='What is the server you want to put in Maintenance Mode?')]
    [Alias("Server")]
    [string[]]$ServerName,
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$false,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. This is a required parameter. Format is 1/29/2014 8:59:26 AM')]
    [Datetime]$end,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='PlannedOther, UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity')]
    [string]$Reason,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Allows you to type a comment about the maintenance activity.')]
    [string]$Comment,
    [switch]$EventLog
    set-strictmode -version latest
    #$start=Get-Date
    #$currentlog = $start.ToString()
    Write-Verbose "Starting $($myinvocation.mycommand)"
    Write-Verbose "Ready to put ServerName $ServerName in Maintenance Mode"
    Function Start-SCOMMaintenanceModeForServer
    [CmdletBinding(SupportsShouldProcess=$true)]
    param
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='What is the server you want to put in Maintenance Mode?')]
    [Alias("Server")]
    [string[]]$ServerName,
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$false,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. This is a required parameter. Format is 1/29/2014 8:59:26 AM')]
    [Datetime]$end,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='PlannedOther, UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity')]
    [string]$Reason,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Allows you to type a comment about the maintenance activity.')]
    [string]$Comment,
    [switch]$EventLog
    Begin
    Write-Verbose "Starting Function Start-SCOMMaintenanceModeForServer"
    #Check for minumum Maintenance mode period of 5 mins.
    $start = Get-Date
    $5MinFromNowTime = $start.AddMinutes(5)
    #$end = [datetime]$end
    $end = $end.AddSeconds(5)
    if($end -lt $5MinFromNowTime)
    Write-Error "The time span for the maintenance mode should be at least 5 minutes." -ErrorAction Stop
    Write-Verbose "Following server will be put in Maintenance Mode: $ServerName"
    $MSs = Get-SCOMManagementServer
    } #End Begin
    Process
    Write-Verbose "Checking if server $ServerName is a Management Server"
    #Write-Verbose ($MSs | Select DisplayName)
    if(($MSs | Select DisplayName) -eq $ServerName)
    Write-Verbose "We don't want to put a Management Server in Maintenance Mode. Skipping"
    else
    Write-Verbose "Let's put server $ServerName in Maintenance Mode"
    $Instance = Get-SCOMClassInstance -Name $ServerName
    if ($PSCmdlet.ShouldProcess("Putting $ServerName in Maintenance Mode until $($end).") )
    Write-Verbose ("Start-SCOMMaintenanceMode -Instance " + $Instance + " -EndTime " + $end + " -Reason " + $Reason + " -Comment " + $Comment)
    Start-SCOMMaintenanceMode -Instance $Instance -end $end -Reason $Reason -Comment $Comment
    }#End of whatif
    }#End of else
    if ($PSBoundParameters['EventLog'])
    write-eventlog -LogName "Operations Manager" -Source "OpsMgr SDK Service" -EventID 999 -message "The following Objects are put into in Maintenance Mode until $($end) : $($ServerName)"
    }#End if
    } #End Process
    End
    Write-Verbose "Finished Function Start-SCOMMaintenanceModeForServer Function"
    #Main
    try
    if ($PSBoundParameters['EventLog'])
    write-eventlog -LogName "Operations Manager" -Source "OpsMgr SDK Service" -EventID 998 -message "The $($myinvocation.mycommand) is used to put Objects in Maintenance Mode"
    Write-Verbose "Checking if OperationsManager Module is loaded"
    #Check if OperationsManager Module is loaded.
    if(!(Get-Module OperationsManager))
    Write-Verbose "Importing OperationsManager Module"
    Import-Module OperationsManager -ErrorAction Stop
    Write-Verbose "Checking for OM2012 environment"
    #Check if OM2012 is being used.
    if(!(Get-Module OperationsManager).Description -eq "Operations Manager OperationsManagerV10 Module")
    Write-Error "This script is only for OM2012"
    #Call Function
    if ($PSBoundParameters['EventLog'])
    Start-SCOMMaintenanceModeForServer -ServerName $ServerName -end $end -Reason $Reason -Comment $Comment -EventLog
    else
    Start-SCOMMaintenanceModeForServer -ServerName $ServerName -end $end -Reason $Reason -Comment $Comment
    } #End Try
    catch [System.IO.FileNotFoundException]
    "OperationsManager Module not found"
    $_.Exception.Message
    catch
    Write-Warning "Oops something went wrong"
    $_.Exception.Message
    $end=Get-Date
    Write-Debug ("Total processing time {0}" -f ($end-$start).ToString())
    Write-Verbose "Ending $($myinvocation.mycommand)"
    There is one remaining problem with this script.   It does not correctly check to see if something is a management server. We have two management servers. These are the applicable lines, which I still haven't gotten to work yet. First, this retrieves
    the list of my Management servers:
    $MSs=Get-SCOMManagementServer     
    Next, these lines are supposed to check if the server I specified is a management server:
    if(($MSs | Select DisplayName) -eq $ServerName)
    Write-Verbose "We don't want to put a Management Server in Maintenance Mode. Skipping"
    Thanks to the Intellisense pop-up deal, I can see that $MSs does get my two management servers. And I can clearly see that there is a DisplayName column. And I can also see that the $ServerName does match what I put in my command line.   But it doesn't
    seem to catch them if they are actually equal to each other. I don't know if it's because there's two Management Servers, and it doesn't know how to compare like that? Any idea? Is there some sort of loop I need to write so that it compares is to the DisplayName
    for EACH Management Server it finds? Any help would be greatly appreciated.

  • Maintainence Mode script for SCOM 2012

     Hi All
     Currently we use PowerShell script to place servers in maintenance mode (SCOM 2007 ). While executing the script we specify a text file which contains list of agents.
     Am looking for same type of script which can work for SCOM 2012. After searching I got the MM tool for placing agent or group in Maintenance. Instead I would need the script to get agents from text file. Also it should check if agent is part of
    cluster and place related cluster also in MM.
    Let me know , if any one can help me here.
    Regards
    Madhavi

    Hi,
    The below two links should be helpful for you, please go through them:
    SCOM 2012: Put Cluster Node and Cluster Object in Maintenance Mode
    OpsMgr 2012: Group Maintenance Mode via PowerShell (the way it should be)
    http://www.systemcentercentral.com/opsmgr-2012-group-maintenance-mode-via-powershell-the-way-it-should-be/
    Please Note: Since site is not hosted by Microsoft, the link may change without notice. Microsoft does 
    not guarantee the accuracy of this information the web.
    Regards,
    Yan Li
    Regards, Yan Li

  • How to get list of tables/users that are under audit

    Hello,
    For testing perpose I have set audit on many tables and users.
    Is there any view or table from which I get list of objects that are kept under audit?
    Noaudit All command for disabling all of them does not work properly. I have to exactly revert audit to stop.
    Means if I write audit insert on table1;
    Now for disabling this, if I write noaudit all then it dont works but If I write noaudit insert on table1 then it works.
    So I need a list on which objects I start audit.
    Or is there any other way to stop them?
    Regards,
    Bhavin M Mistry...

    Try
    DBA_STMT_AUDIT_OPTS
    DBA_PRIV_AUDIT_OPTS
    DBA_OBJ_AUDIT_OPTS
    SYS@etest> audit role;
    Audit succeeded.
    SYS@etest> SELECT * FROM DBA_STMT_AUDIT_OPTS;
    USER_NAME                      PROXY_NAME
    AUDIT_OPTION                             SUCCESS    FAILURE
    ROLE                                     BY ACCESS  BY ACCESS

  • Dynamic Group containing maintenance mode devices

    Hi,
    I am using a scheduled script to put a large number of items in maintenance mode for periods of time where we do not which to receive alerts or cause DA state changes. For these objects, the time is overnight or weekends.
    The script adds all objects in a dynamic group into maintenance mode. This includes both windows and network devices.
    My issue is that when an engineer manually puts an item into maintenance mode for genuine maintenance purposes, it may be overridden. 
    So my idea is to have another dynamic group containing all objects in maintenance mode, and make it an exclusion in the original group. Is this possible or is there a better way?
    FYI The script I am using for the bulk maintenance mode is based from here:
    http://www.systemcentercentral.com/opsmgr-2012-group-maintenance-mode-via-powershell-the-way-it-should-be/

    Hi,
    We can use below command to get all members in a group:
    $Groups = Get-MonitoringObjectGroup  
    $Group = $Groups | where {$_.DisplayName -eq "Group Name"}   
    $Members = $Group.GetRelatedMonitoringObjects()   
    And with below command we could get all members that in maintenance mode:
    $Members | where{$_.inmaintenancemode -eq $true}
    With set-SCOMMaintenanceMode command we can update active maintenance mode entries.
    http://technet.microsoft.com/en-us/library/hh920197(v=sc.20).aspx
    Regards, Yan Li

  • 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

  • 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

  • Three agent UR versions gets installed from gateway - SCOM 2012 SP1 UR4

    Hi,
    We have a SCOM 2012 SP1 UR4 installation with several gateways that servers connect to and get installation from.
    We noticed that when the agent get installed on a client server it gets first the agent itself, then UR1, UR2 and last UR4.
    From the XML-section in the task that has installed the agent one can read the following:
    SoftwareUpdateInstalled KB2784734-amd64-Agent.msp;KB2826664-amd64-Agent.msp;KB2880799-amd64-Agent.msp; SoftwareUpdateInstalled
    Below is from the application log of a newly installed server that got the agent installed.
    The question I have is if this is correct? Why are all three UR installed?
    Shouldn't it be enough with the latest version of UR? Are they not cumulative?
    Can I simply delete the older versions in the agent directory of the Gateway?
    Regards S-E
    Windows Installer installed the product. Product Name: System Center 2012 - Operations Manager Agent.
    Product Version: 7.0.9538.0. Product Language: 0. Manufacturer: Microsoft Corporation.
    Installation success or error status: 0.
    Windows Installer installed an update. Product Name: System Center 2012 - Operations Manager Agent.
    Product Version: 7.0.9538.0. Product Language: 0. Manufacturer: Microsoft Corporation.
    Update Name: System Center 2012 - Operations Manager SP1 UR1 Update Patch.
    Installation success or error status: 0.
    Windows Installer installed an update. Product Name: System Center 2012 - Operations Manager Agent.
    Product Version: 7.0.9538.0. Product Language: 0. Manufacturer: Microsoft Corporation.
    Update Name: System Center 2012 - Operations Manager SP1 UR2 Update Patch.
    Installation success or error status: 0.
    Windows Installer installed an update. Product Name: System Center 2012 - Operations Manager Agent.
    Product Version: 7.0.9538.0. Product Language: 0. Manufacturer: Microsoft Corporation.
    Update Name: System Center 2012 - Operations Manager SP1 UR4 Update Patch.
    Installation success or error status: 0.
    Windows Installer installed the product. Product Name: Active Directory Management Pack Helper Object.
    Product Version: 1.1.0. Product Language: 1033. Manufacturer: Microsoft Corporation.
    Installation success or error status: 0.

    Hi,
    This should be normal, as we can see in the below two articles. When applying Update Rollup 2, UR1 is listed there, and when applying Update Rollup 3, UR1 and UR2 is listed there also.
    http://blogs.technet.com/b/kevinholman/archive/2013/04/11/applying-update-rollup-2-ur2-to-opsmgr-2012-sp1.aspx
    http://blogs.technet.com/b/kevinholman/archive/2013/09/27/applying-update-rollup-3-ur3-to-opsmgr-2012-sp1.aspx
    For example, UR3 can be applied to System Center Operations Manager 2012 SP1 (as released) or a SCOM 2012 SP1 deployment that has had UR1 or UR2 already applied.
    Regards,
    Yan Li
    Regards, Yan Li

  • SCOM 2012 SP1 Can't get email alerts for Heartbeat Failure or Computer Unreachable when combined with Group.

    Hello,
    I have SCOM 2012 SP1 RTM POC lab.  I have created a dynamic group that picks up my system center servers based on some simple criteria and this works fine.
    I have set up a subscription for critical and high severity alerts originating from this dynamic group called SCOM Servers to send emails to a distribution.  This also worked well for any critical alert that was NOT Heartbeat Failure or Computer Unreachable. 
    I see those in the console but no email.
    So I set up a new subscription by right clicking on the alerts and here's the kicker.  If add no other conditions to these subscriptions, they will send emails to the DL I provided, but if add the condition initiating from group, and specify my dynamic
    group SCOM servers, no email alert.  But the alert still appears in the console.
    Any ideas on this?  I would like the appropriate support groups to get these types of alerts for the servers that they support (i.e. SCOM will get SCOM servers, Exchange Admin will get Exchange and never the two roads shall meet.).
    I even tried some internet posted custom management pack, but I couldn't import it after adding the code that he listed.
    I mean, isn't this a basic requirement for any mid-sized company?
    Any help is greatly appreciated.

    Hi Donald,
    Like Dan says you need to add the "Health Service Watcher" objects to the groups as wel. Unfortunately this cannot be done in the Dynamic group Editor but has to be done in the XML. Export the XML and add the following piece of code between the
    lines </MembershipRule></MembershipRules>:
    <MembershipRule>
     <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass>
    <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary7084300!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
    <Expression>
    <Contains>             
    <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthService"]$</MonitoringClass>
          <Expression>
    <Contained>         
    <MonitoringClass>$MPElement[Name="MicrosoftWindowsLibrary7084300!Microsoft.Windows.Computer"]$</MonitoringClass>
              <Expression>
                <Contained>
                  <MonitoringClass>$Target/Id$</MonitoringClass>
                </Contained>
              </Expression>
            </Contained>
          </Expression>
        </Contains>
      </Expression>
    </MembershipRule>
    Save the XML delete the old one in OpsMgr and import the edited.
    For SP1 the SystemLibrary version is 7.0.8430.0. If this is not your version you need to edit this in the code above.
    Hope this helps,
    Regards Marthijn van Rheenen
    Blog: Heading To The Clouds

  • 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

Maybe you are looking for

  • Can't open fcp file-HELP!!!

    after working on a tracksheet with no problems for a month it suddenly won't open - at about 27% open, it stops loading and i get general error (41) - any ideas? HELP!!!!!!! - I've GOT to get in this thing! thx!

  • New order type creation ?

    Hi, While creating a new order type what points we need to remember ? And what information we need to get from the user. As per my knowledge i can create the order type as 01) Define order types 02) Order type dependent parameters 03) Define number r

  • Will there be a BlackBerry Classic like device in the Future?

    Will there be a BlackBerry Classic like device in the Future? Solved! Go to Solution.

  • Album art dimensions?

    What are the ideal dimensions of iTunes album art? After hours of searching, I'm still convinced someone in the world must know the ideal dimensions of album art is. After all, someone designed the app. I'm sure when I first began publishing a video

  • Relation between object US and object S

    Hi, when i affect a User (US object) to a Position (S object) i have the following line in HRP1001 (in brief) : OTYPE    RELATION     SCLAS S                A008             US Nice but i need also the following line : OTYPE    RELATION     SCLAS US