This is variation of previous posts like these ones I just use remove-disabledmonitoringobject for the last steps which I think is safer.
Find agentless objects in agentless managed view. In our case they were cluster computer names and had a class of ‘windows computer’ and name = fqdn of the cluster server name. (not the two servers that hosted it). The agent machines were already decom but couldn’t be deleted from scom. The proxy agent pointed at a node we were trying to delete but couldn’t
In sql find it in bme table by query
SELECT BaseManagedEntityId, BaseManagedEntityInternalId, BaseManagedTypeId, FullName, Path, Name, DisplayName, TopLevelHostEntityId, IsManaged,
IsDeleted, LastModified, OverrideTimestamp
WHERE (Name LIKE '%CLUSTERXYZ%') AND (FullName LIKE '%Computer%')
ORDER BY FullName
Copy the FIRST column BaseManagedEntityID e.g
run a select by ID to be 900% certain you have the right object
SELECT * FROM dbo.[BasemanagedEntity] where
You should get 1 result with correct looking name etc.
Then run the update query to make scom think it is deleted
BE INSANELY CAREFUL RUNNING THIS QUERY – SCREW UP THE WHERE CLAUSE AND YOU WILL DESTROY SCOM. MAKE SURE THE UPDATE CAN ONLY TARGET THE ONE OBJECT THAT IS VALID
SET IsDeleted = 1
now refresh ‘agentless managed’ and problem object should have disappeared. Repeat this for any invalid clusters that still appear in agentless managed.
Now it will let you delete the agent’s machines from the cluster in agent managed view.
Open command shell and run this to clean up any mess.
This will find all the cluster class child objects and make them ‘is deleted’ etc. Some posts have this as a manual step with more db updates of multiple objects in BME table but I think this way is safer.
At this point the clusters should disappear from 'monitoring' views.