MOM 2005 - SQL Query to return Only Managed computers that belong to a Computer Group

MOM 2005 SQL Query to return Only Managed computers that belong to a Computer Group


This query returns only Agent Managed Computers names for a specific Computer group.
The results will not include Cluster Server names.

Props to my DBA buddy Nick DeAngelo for pointing me in the correct direction with the syntax.
The second bit of SQL code was borrowed from from Roy McCaw Blog http://rorymccaw.spaces.live.com see post Nov 2005.


-- Scott Moss
-- 09/08/07
-- Managed Computers that belong to a specific Computer Group
-- This query returns the Managed computers (Cluster Names will not be in this list)
-- that belong to a specific Computer group.

select [Name] from Computer
WHERE [IsConfigManager]=0 AND ManagedType = '2' AND
(idConfigManager IS NULL OR idComputer <> idConfigManager) AND 
IsAddedByServiceDiscovery = 0 AND [Type] <> 67108864

AND [Name] in (SELECT [ComputerName]
FROM [OnePoint].[dbo].[SDKComputerToComputerGroupView]
WHERE ComputerGroupName = 'YOUR COMPUTER GROUP NAME HERE')

BeerPizzaParty!!!

Comments

No Comments