I have a wmi script that returns All the printers on a machine, but I'm having
issues getting the information to disply.
Code:
<!--
Comand Line Print List Probe (sd68.bc.ca.printer)
Displays printers on a Server
--Aaron Arnold
-->
<header>
type="cmd-line"
package="sd68.bc.ca"
probe_name="printers"
human_name="Windows Printer List"
version="1.0"
address_type="IP"
</header>
<description>
\GB\Printers\p\
This probe lets list Windows printers using a custom WMI VB script. It passes
the IP address of the host ($ADDRESS) to a script which attempts to access the
share.
This probe loads the VB script "shareprobe" from the "tools" folder under
"intermapper settings".
</description>
<command-line>
-- Empty path forces the InterMapper Settings:Tools directory
path=""
cmd="c:\windows\system32\cscript.exe -nologo "c:\program
files\intermapper\intermapper settings\tools\ListPrinters.vbs""
arg="${ADDRESS}
</command-line>
<command-data>
-- Currently unused.
</command-data>
<command-exit>
</command-exit>
<command-display>
</command-display>
<output>
</output>
Code:
set objargs = Wscript.Arguments
If objargs.Count <> 1 then
WScript.Echo "Bad args"
Wscript.Quote(1)
End if
strComputer = ObjArgs(0)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
wscript.echo objPrinter.name
Next
-------------------- m2f --------------------
Read this topic online here:
http://forums.intermapper.com/viewtopic.php?p=3759#3759
____________________________________________________________________
List archives:
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]