WMI query

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
 
M

Mark L. Ferguson

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top