SCOM agent removal

Bojan Zivkovic 526 Reputation points
2025-02-08T19:36:58.49+00:00

Hi, I have connected SCOM agents (already connected to Management Group with Management Server in their domain) to Management Group in other forest (no trust in place) using SCOM Gateway Server. Now I'd like to remove SCOM agents from Management Group in their domain so I can later uninstall other Management Group components (in SCOM agents' domain). Having deleted SCOM agent of one server in SCOM console (previously I had removed connection to Management Group in its domain) I saw it back a few minutes later (healthy as before deletion).

Why is this happening? If I uninstall SCOM agent (instead of deleting), that will obviously do what it says - but my idea is to keep existing SCOM agents connected only to Management Group in other forest and not showing up in Management Group in their domain.

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,534 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AlexZhu-MSFT 6,501 Reputation points Microsoft Vendor
    2025-02-10T02:06:59.0266667+00:00

    Hi,

    It seems we need to change the management group of the agents. We can try the following PowerShell script (in the agent machine) to see if it helps.

        $mma1 = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg'  
        $mma1.RemoveManagementGroup('test02')  
        if ($? -eq 0)  
        {  
            write-host "management group test02 was removed!"  
        }  
        $mma1.AddManagementGroup('test03' , 'om22.sc.com' , 5723)   
        if ($? -eq 0)  
        {  
            write-host "management group test03 was added!"  
        }  
        $mma1.ReloadConfiguration()  
    
    

    Regards,

    Alex

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.