How to multihome a large number of agents in SCOM


<!--[if lt IE 9]>

<![endif]-->


Comments (12)

Cancel reply

  1. M.Mathew says:

    Another great article!! .Thanks @Kevin!

  2. msviborg says:

    Hi Kevin
    Another great article making life as a SCOM admin a lot easier – THANK YOU!
    We have a regional domains and dedicated Management Servers per region. Would it be possible to control that via this script?
    I’m thinking like controlling which group the servers are added to, via a suffix or something, and then making sure the server in that group is added to a specific Management Server?

    Thanks in advance
    Michael

    1. Kevin Holman says:

      Yes, sure you could do this…. for the initial multi-home to a second management group.

      Why do you have regional management servers? Do you mean multiple management servers, in the same SCOM management group, but in different locations? If that’s the case, that’s a really bad design. Management servers should all be in the same physical location/network and so should the SCOM DB’s. Gateways can be location dependent if really required.

  3. stemo76 says:

    Thanks again for the great contribution. I ran this over the weekend with pretty good success. We recently installed a 1801 SAC instance and have started the migration.

    I did the groups a bit differently. Created a new property using HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Agent Management Groups\PBCACPT\Parent Health Services\0\AuthenticationName

    Now I can build groups based on the current primary management server and build a mapping to the new management servers in the new instance.

    For some reason I did get a lot of these errors but when running the commands locally on the server it worked, and the applet was updated. I haven’t found the cause.

    Event Description: SCOM.MultiHome.AddMG.Rule.WA.ps1 :
    FATAL ERROR: No management groups were found on this agent, which means a scripting error.
    Terminating script.

    1. stemo76 says:

      I see the reason I am getting those error but I don’t know why the count value isn’t being populated. Checked another server with the same PS version and it works fine.

      Copyright (C) 2009 Microsoft Corporation. All rights reserved.

      PS C:\Windows\system32> # Load Agent Scripting Module
      PS C:\Windows\system32> $AgentCfg = New-Object -ComObject “AgentConfigManager.MgmtSvcCfg”
      PS C:\Windows\system32> $MGs = $AgentCfg.GetManagementGroups()
      PS C:\Windows\system32> $MGsCount = $MGs.Count
      PS C:\Windows\system32> $mgscount
      PS C:\Windows\system32> $mgs.count
      PS C:\Windows\system32> $mgs

      managementGroupName : InstanceName
      ManagementServer : Server.corp.Company.org
      managementServerPort : 5723
      IsManagementGroupFromActiveDirectory : False
      ActionAccount : Local System

      1. Kevin Holman says:

        I have seen this before – it has to do with the object type for “$MGs = $AgentCfg.GetManagementGroups()”

        What I did was loop through each one and build a strong type defined [array]$whatever to count on. I just tested this on one of my WS2012R2 agents and it has the same issue.

        FOREACH ($MG in $MGs)
        {
        $MGCount++
        }

        That will give you a reliable count I think…..

        1. stemo76 says:

          I made that change in the script and will see if that stops those alerts and updates the last few servers that have to migrate. I tested on one of the boxes that would consistently fail and the FOR loop worked.

          Also for some reason that .count function would often cause the PowerShell window to crash

        2. stemo76 says:

          Made the change yesterday and it appears to be working good. A couple servers got the config change and no new errors.

  4. Atif Aman says:

    I built new SCOM 2016 replacing old 2012.

    Also i did multihoming by discovering and installing SCOM 2016 agents on all servers now all agents display both SCOM groups (SCOM2012 and SCOM2016).

    Now that my environment is stable and i want to decommission SCOM2012 i don’t know how to remove the old instance from SCOM 2016 agents at monitored servers.

    Can you please help me

    1. Kevin Holman says:

      Use the SCOM management MP I wrote – to remove a management group.

      1. Atif Aman says:

        Should I install your MP on Old system or new SCOm2016?

        Thanks
        Atif

  5. Atif Aman says:

    Hi Kevin,
    I rebuild the new environment of SCOM2016 and now I need to remove multihoming from of all agents from managed servers because we are decommissioning the old SCOM2012 environment.
    Is there any easy way to remove old SCOM2012 SCOM group entry from management servers SCOM2016 Agents.

    Thanks in advanced for your guidance.
    Atif Aman

Skip to main content