Stale computer objects in Operations Manager 2007
The normal procedure in System Center Operations Manager 2007 (SCOM) to remove agents, is to use the "Uninstall" task from the Agent-Managed Computer view in the Administration section of the Operations Console. This kicks off a decent MSI de-installation remotely and deletes any registry references and files on disk. If the machine is already decommissioned, you can use the "Delete" function from that same space, but due make sure that this agent will not be brought to live at any point in time (this will cause strange behavior). The internal grooming job will delete any references to this computer object from the Operational database, when it runs.But what if anything goes wrong in this process? For instance; the Uninstall and/or Delete job seem to have worked fine and show a green end result, but looking at the Computers view in the Monitoring section, still shows the Computer but with a gray icon in front of it. You go back to the Agent-Managed Computers space, but cannot find the machine there, and the server itself does not have the agent installed anymore either.

There seems to be a - UNSUPPORTED - solution to this. Note: this does mean that we will be manually editting the (Operational) database and can cause serious damage if executed inproperly. Therefore; any steps hereunder can only be used at your own risk!
System Center Operations Manager 2007 stores all "entities" it "manages" in the BaseManagedEntity table in the Operational database (named "OperationsManager", by default). This is the place where we will be manually telling SCOM that this computer does not exist anymore. There's a column called "IsDeleted" that stores if the agent was removed. Run this query syntax to show a list of all current computer objects and their status:
SELECT * FROM dbo.[BasemanagedEntity] where FullName Like '%Windows.Computer%'

In the case of these "stale" objects, you will find the computer name and the "IsDeleted" column will proabaly show 0 (zero). This means that the database does not know that it was removed and the uninstallation or deletion procedure has run incorrectly. It is just a matter of changing this value to 1 (one) for these computers, and they will be groomed at the next run. Setting the value can be done by running the following query syntax (again; target this at the Operational database):
UPDATE dbo.[BasemanagedEntity] SET IsDeleted = 1 where FullName Like '%Windows.Computer%' and Name Like '%FQDN.of.my.computer%'

As marked RED in the example: you must change the name to the name of the machine which you want to have removed. Going back to the Operations Console en to the Monitoring & Computer section, shows us that the computer does not show in the list already. It will still take some time before it really gets deleted in the database, but visually you are already set. (Do note that the machine and its child objects like disk and CPU are still there in the Datawarehouse. This will stay there untill that expired there also; which is 360 days by default).
Credits: this article used information and knowledge from this blog entry: http://ops-mgr.spaces.live.com/blog/cns!3D3B8489FCAA9B51!163.entry, written by my fellow MVP Cameron Fuller.
-- Maarten Goet









Thanks! this was very helpful
Rob Rowald - 12 January '10 - 16:05