*******************************************************************
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
*******************************************************
Hi,
ReplyDeleteDo you have any query to count local printers too?
Hello nAJAm,
ReplyDeleteyou can try with this one:
http://sccmrookie.blogspot.com.es/2015/03/report-count-local-printers.html