I have tried that.  With what I have leared I changed a few things, after 
reading more of the documentation. But I still have issues, same error.


 

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="Listprinters" 
human_name="Windows Printer List" 
version="1.0" 
address_type="IP" 
</header> 

<description> 

This probe list Windows printers using a custom WMI VB script.  It passes the 
IP address of the host ($ADDRESS) 

to a script which attempts list all printers.

</description> 


<command-line>
-- Empty path forces the InterMapper Settings:Tools directory
path="" 
cmd="${CSCRIPT} ListPrinters.vbs"
arg="${ADDRESS} 
</command-line> 

<command-data> 
-- Currently unused. 
</command-data> 

<command-display>
 ${^stdout} 
</command-display>



<tool:ListPrinters.vbs>
set objargs = Wscript.Arguments
If objargs.Count <> 1 then
        WScript.Echo "Bad args"
        
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 
Wscript.echo objprinter.sharename 
Next

</tool:ListPrinters.vbs>





-------------------- m2f --------------------

Read this topic online here:
http://forums.intermapper.com/viewtopic.php?p=3778#3778





____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]

Reply via email to