I'm preparing for a migration of SCOM from 1807 to 2019. It's going to be a Side-By-Side migration with no in-place upgrade. All new infrastructure.
One of the things I want to do is identify all custom groups that are now redundant, in the existing platform, by getting a report on all empty groups. Empty groups likely used to contain Windows Servers that have all now been decommissioned. As Groups in sealed MPs can't be as easily removed as Rules and Monitors, I'd like to ensure that I am removing any redundant groups from our Custom Discovery MPs, before they go into the new SCOM platform.
Can anyone point me any scripts that might read all SCOM Groups and spit out a count for each? We don't have any nesting, so recursive scanning of groups isn't required.