locked
Collecting Printer Info Via SCCM 2007 RRS feed

  • Question

  • Hi,

    I'm need to run some reports to collect data on some clients of what local/network printers they have installed? 

    I've run locally the "DataShift" script and also edited my SMS_def.mof on my server...I've triggered off a hardware invetory on the client but when I come to run a SQL report I just keep getting things like "Invalid Location0" 

    This is the SQL report I'm trying to run

     

    SELECT SYS.Netbios_Name0,printer.ShareName0,printer.DriverName0, printer.Location0,printer.PortName0,printer.PrintProcessor0

      FROM v_GS_PRINTER_DEVICE printer

      JOIN v_R_System SYS ON SYS.ResourceID = printer.ResourceID

      ORDER BY SYS.Netbios_Name0

     

    Any ideas or help would be appreciated?

    Cheers,

    Paul.


    Thursday, July 21, 2011 9:42 AM

Answers

  • I don't have the SCCM Expert printer views in my CM07 lab so I manually edited WQL to turn it into SQL. This should work.

    select 
    	P.DeviceID, 
    	P.Shared, 
    	P.PortName, 
    	P.ShareName, 
    	P.Local, 
    	P.PrinterState 
    from 
    	v_R_System R
    	inner join v_GS_SMXPRINTERS P on P.ResourceID = S.ResourceId
    

     


    http://www.enhansoft.com/
    Sunday, July 31, 2011 9:29 PM

All replies

  • Hi Paul - does this user's experience help at all?

    http://www.geekshangout.com/node/41

    Cheers, James

    Thursday, July 21, 2011 12:21 PM
  • Have you ensured that the mof was imported successfully?

    Have you looked on the client to ensure the data is properly added to WMI?

    Have you reviewed hman.log?

    Have you reviewed the database itself to see if there is any data there for the new info?


    Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys
    Thursday, July 21, 2011 1:15 PM
  • Hi Jason,

    Yeah It's pulling the data through, I tested this with a query through SCCM, and that works as I only run the script on my machine and it's working via the table "SMX Printers" 

    So I think all I need now is to put that query into a report????? With the choice of selecting a certain collection/boundary group?

    (This is the query I'm using)

     

    select SMS_G_System_SMXPRINTERS.DeviceID, SMS_G_System_SMXPRINTERS.Shared, SMS_G_System_SMXPRINTERS.PortName, SMS_G_System_SMXPRINTERS.ShareName, SMS_G_System_SMXPRINTERS.Local, SMS_G_System_SMXPRINTERS.PrinterState from  SMS_R_System inner join SMS_G_System_SMXPRINTERS on SMS_G_System_SMXPRINTERS.ResourceID = SMS_R_System.ResourceId

     


    Friday, July 22, 2011 7:32 AM
  •  

    So I think all I need now is to put that query into a report????? With the choice of selecting a certain collection/boundary group?

     

    The below method explained by John Marcum would help to make good reports...
    http://myitforum.com/cs2/blogs/jmarcum/archive/2011/05/19/157675.aspx
    Anoop C Nair - This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Saturday, July 23, 2011 2:55 AM
  • I don't have the SCCM Expert printer views in my CM07 lab so I manually edited WQL to turn it into SQL. This should work.

    select 
    	P.DeviceID, 
    	P.Shared, 
    	P.PortName, 
    	P.ShareName, 
    	P.Local, 
    	P.PrinterState 
    from 
    	v_R_System R
    	inner join v_GS_SMXPRINTERS P on P.ResourceID = S.ResourceId
    

     


    http://www.enhansoft.com/
    Sunday, July 31, 2011 9:29 PM