Thursday, 25 September 2014

SCCM Report printer inventory

This useful report will show a complete inventory of your network printers:

*******************************************************************

SELECT    

'Numero Total de Impresores' AS Type, COUNT(PPR.DeviceID0) AS [Count of Devices]
FROM         dbo.v_GS_PRINTER_DEVICE PPR INNER JOIN
                      dbo.v_R_System ON PPR.ResourceID = dbo.v_R_System.ResourceID
INNER JOIN V_fullCOLLECTIONmembership CCO ON CCO.ResourceID = PPR.ResourceID
WHERE  CCO.CollectionID like 'SMS000DS' AND (PPR.Caption0 NOT LIKE 'Microsoft Office Document%' AND PPR.Caption0 NOT LIKE 

'%pdf%' AND PPR.Caption0 NOT LIKE '%Microsoft XPS%')


UNION

SELECT  'Numero Total PrintServers' AS Type, COUNT( DISTINCT dbo.v_R_System.ResourceID) AS [Count of Devices]
FROM         dbo.v_R_System INNER JOIN
                      dbo.v_GS_PRINTER_DEVICE ON dbo.v_R_System.ResourceID = dbo.v_GS_PRINTER_DEVICE.ResourceID
INNER JOIN V_fullCOLLECTIONmembership ON v_fullcollectionmembership.ResourceID = dbo.v_GS_Printer_Device.ResourceID
WHERE  v_Fullcollectionmembership.CollectionID like 'SMS000DS'

SELECT Distinct SYS.Netbios_Name0,PRT.DriverName0, PRT.DeviceID0,PRT.PortName0 
FROM v_R_System SYS 
INNER JOIN v_GS_PRINTER_DEVICE PRT on SYS.ResourceID = PRT.ResourceID
INNER JOIN V_fullCOLLECTIONmembership CCO ON cco.resourceID  = SYS.ResoUrceID

WHERE  CCO.COLLECTIONid  like 'SMS000DS'AND (PRT.Caption0 NOT LIKE 'Microsoft Office Document%' AND PRT.Caption0 NOT LIKE 

'%pdf%' AND PRT.Caption0 NOT LIKE '%Microsoft XPS%')
order by Netbios_Name0

*******************************************************

2 comments:

  1. Hi,

    Do you have any query to count local printers too?

    ReplyDelete
  2. Hello nAJAm,

    you can try with this one:

    http://sccmrookie.blogspot.com.es/2015/03/report-count-local-printers.html

    ReplyDelete

Give me you feedback!