Home > SQL Queries > Decommissioned Servers still appearing in console

Decommissioned Servers still appearing in console

More great information from Kevin Holman posted originally on the technet forums.

If you delete an agent via agent managed – and yet you still see a Windows Computer object for it…. then this means:

1. It hasnt groomed out yet or hasnt been marked as deleted. Wait a few days.

2. A discovery is still associated with this managed object.

To determine which discoveries are still associated with a managed object that you expect to be deleted:

To determine what discoveries are still associated with a computer – helpful in finding old stale computer objects in the console that are no longer agent managed, or desired.

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%’

change computername to yours.

Advertisements
Categories: SQL Queries
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: