How to remove subgroups in SCOM 2016 by script?

AUL Uwe 1 Reputation point
2020-11-04T13:28:39.157+00:00

Hello,

I try to delete groups in SCOM 2016 by powershell script. This works for all groups, exept they are subgroups of another group. How can I remove the subgroup relationship by script to be able to delete this group in the next step?

Thank you!!

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,413 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. SChalakov 10,261 Reputation points MVP
    2020-11-04T15:47:04.9+00:00

    Hi,
    a dumb question maybe: Have you tried with this script:

    Automating OpsMgr Part 10: Deleting Groups
    https://blog.tyang.org/2015/07/27/automating-opsmgr-part-10-deleting-groups/

    Regards,
    Stoyan

    0 comments No comments

  2. AUL Uwe 1 Reputation point
    2020-11-05T04:56:41.33+00:00

    Hi Stoyan,

    yes, I already saw that script and included the part of deleting monitors targeting the group in my script.
    Nevertheless it doesn't work for subgroups.

    Kind regards,
    Uwe

    0 comments No comments

  3. AUL Uwe 1 Reputation point
    2021-11-08T13:56:33.5+00:00

    I'm still looking for a solution. Any ideas appreciated!

    0 comments No comments