Hi,
For this query, we can remove the existing management group and add new one using the similar powershell script.
Note: we need change the script to cater for the real environment, for example, the mangement group name, the primary management server, etc.
$mma1 = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg'
$mma1.RemoveManagementGroup('test02')
if ($? -eq 0)
{
write-host "management group test02 was removed!"
}
$mma1.RemoveManagementGroup('test01')
if ($? -eq 0)
{
write-host "management group test01 was removed!"
}
$mma1.AddManagementGroup('test03' , 'om22.sc.com' , 5723)
if ($? -eq 0)
{
write-host "management group test03 was added!"
}
$mma1.ReloadConfiguration()
screenshot from the lab test before the script is run
screenshot from the lab test after the script is run
Alex
If the response is helpful, please click "Accept Answer" and upvote it.