WMI query

  • Thread starter Thread starter jbrunnqu
  • Start date Start date
J

jbrunnqu

XP SP2

I have installed printers on XP and can see them in WMI in win32_printer.
Using cimstudio from a remote PC, I can connect to WMI on the target PC and
can get to Win32_printer but no instances of printers are displayed. How can
I view or enumerate printer instances in Win32_printer on a remote PC?

Thanks
 
Maybe the app is broken. This script (assuming you set strComputer=??)
should do that:

--printers.vbs--
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")

For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name
Wscript.Echo "Location: " & objPrinter.Location
Wscript.Echo "Default: " & objPrinter.Default
Next
--end file--

--
Was this helpful? Then click the Ratings button. Voting helps the web
interface.
http://www.microsoft.com/wn3/locales/help/help_en-us.htm#RateAPostAsAnswer
Mark L. Ferguson
..
 
Back
Top