2 Replies Latest reply on Nov 2, 2008 9:59 PM by puercomal

    Detecting all machines with connected document scanners

    Apprentice

      Is it as difficult as it seems to be?  I see them in inventory but they are "buried" under USB/device/0,1,2,3 etc. (Assuming they are a USB device)

       

      Does anyone know of an easy way to query all machines with scanners attached to them?

       

      Thank in advance.

        • 1. Re: Detecting all machines with connected document scanners
          Apprentice

          I think I got it (But I have to find a machine that actually has a scanner to test this.)  I bet I can narrow this query down to manufacturer=HewlettPackard or something, then right it to the regsitry  (instead of wscript.echo) and then have ldappl go read it.

           

          strComputer = "."
          Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
          Set colItems = objWMIService.ExecQuery( _
              "SELECT * FROM CIM_Scanner",,48)
          For Each objItem in colItems
              Wscript.Echo "-----------------------------------"
              Wscript.Echo "CIM_Scanner instance"
              Wscript.Echo "-----------------------------------"
              Wscript.Echo "Caption: " & objItem.Caption
              Wscript.Echo "Description: " & objItem.Description
              Wscript.Echo "Name: " & objItem.Name
          Next

          • 2. Re: Detecting all machines with connected document scanners
            Employee

            You're assuming that the view it shows you in the inventory view is representative of the underlying schema... while they're close, it isn't always true. In the case of USB ports, the number is not really a higher-level attribute. Here's an exported query that reports all Logitech gear.

             

            Note that Limestone is reporting two instances of the same Logitech mouse, because it's been present on different ports during different inventory scans... I'm not sure if that's a LANDesk problem or a WMI bug, but it is possible. One way to answer that question is to forge ahead with your script... if you see multiple instances, then it's WMI's fault