locked
Maintenance Mode schedule in SCOM 2016 RRS feed

  • Question

  • Hi,

    While creating the Schedule maintenance for multiple servers, couldn't select the whole servers at one shot

    have to add the Objects one by one, Please help me on this to how to add multiple servers at once?


    Thanks, Shiva Ravichandran.


    Monday, July 27, 2020 7:56 PM

All replies

  • Hi Shiva,

    This is not an authoring question.  You should post this in the General Section.

    That said, as long as you don't click "OK" you can keep on adding.  Or leave the filter empty and click on Search to see them all and then you can multi select to add.

    Tuesday, July 28, 2020 1:24 PM
  • Hi,

    Besides PChip's suggestion, if we want to put multiple servers into maintenace mode, we may consider using the following script

    $file=Read-Host "Please give file path consist of FQDN of servers to be in maintenance mode"
    $servers=Get-Content $file
    $MaintenanceTime=Read-Host "Number of minutes for maintenance"
    $Reason=Read-Host "Reason for Maintenance"
    $i=0
    foreach($server in $servers)
    {
        $i++
        $Instance = Get-SCOMClassInstance -Name $server
        $Time = ((Get-Date).AddMinutes($MaintenanceTime))
        Start-SCOMMaintenanceMode -Instance $Instance -EndTime $Time -Comment $Reason -Reason "PlannedOther"
        $mode=$Instance.InMaintenanceMode
        Write-Progress -Activity "Server: $server" -status "Completed" -percentComplete ($i / $servers.count*100)
       
    }



    Hope the above information helps.

    Regards,

    Alex Zhu
    -----------------------------------------------
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Tuesday, July 28, 2020 1:57 PM