SMSUG.ca

...your virtual communITy
Welcome to SMSUG.ca Sign in | Join | Help
in Search

Garth Jones

Count of PCs by OU v2

 

For more details please see: http://social.technet.microsoft.com/Forums/systemcenter/en-US/aea60e7b-a88b-48d8-8cc3-8675097abe62/trying-to-do-a-report-of-sup-failures-by-ou?forum=configmgrinventory

 

SELECT
    OU.ou,
    COUNT(*) AS 'COUNT'
FROM 
    dbo.v_R_System SYS 
    join (
            select 
                SOU.ResourceID, 
                Max(SOU.System_OU_Name0) as 'ou' 
            from 
                dbo.v_RA_System_SystemOUName SOU
            Group by 
                    SOU.ResourceID) OU on SYS.ResourceID = OU.ResourceID

/*WHERE SYS.Netbios_Name0 IN ( 'PHO-PVR63186',
'WCO-PVP11579',
'PAL-PVI82336',
'LOM-PVI46044',
'LOM-PVI49102',
'LOM-PVR46148',
'PUG-PVI92643',
'RED-PVI54875',
'REN-PVR27553',
'WLA-PVR125834')*/
Group by 
    OU.ou
ORDER BY
    OU.ou

Comments

 

Count of PCs by OU v2 | My CMS said:

Pingback from  Count of PCs by OU v2 | My CMS

March 19, 2014 2:32 PM

This Blog

Syndication

News

Training

Powered by Community Server (Non-Commercial Edition), by Telligent Systems