after renaming a Active Directory computer, the computer was automatically detected in SCOM with the correct new name. but after short time, I detected, that the originally agent was already there, but not reachable. so I deleted the old computer under Device Management – Agent Managed.
normally after maximum 3 days, the agent isn’t visible in the computer view. the delay of 3 days is by design. so don’t delete the computer manually to early.
If you still see the Computer showing up – even after 3 days – then in most cases, there is still a discovery associated with it. To find the discovery, use this query:
SELECT BME.FullName, DS.DiscoveryRuleID, D.DiscoveryName FROM typedmanagedentity TME JOIN BaseManagedEntity BME ON TME.BaseManagedEntityId = BME.BaseManagedEntityId JOIN DiscoverySourceToTypedManagedEntity DSTME ON TME.TypedManagedEntityID = DSTME.TypedManagedEntityID JOIN DiscoverySource DS ON DS.DiscoverySourceID = DSTME.DiscoverySourceID JOIN Discovery D ON DS.DiscoveryRuleID=D.DiscoveryID WHERE BME.Fullname LIKE '%ComputerName%'
in my case, I didn’t found any discovery for this computer and it was still available in the Windows Computer view one week after deletion of the agent.
so I found a solution
***THE FOLLOWING PROCEDURE IS NOT SUPPORTED BY MICROSOFT***
we need to check the database with this query for the orphaned entities:
select * from BaseManagedEntity Where FullName like FullName Like '%Windows.Computer%' and '%ComputerName%' and IsDeleted=0
now we will mark this old entries as deleted:
update BaseManagedEntity set IsDeleted=1 where FullName Like '%Windows.Computer%' and FullName like '%ComputerName%'
after this, make a refresh in your SCOM console. the orphaned Windows Computer shouldn’t be there anymore.