How can I filter a query to printers that are on a specific print server?
When I run the following script I get no hits.
________________
strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from
Win32_Printer Where ServerName='\\print_server'")
For Each objItem in colInstalledPrinters
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "ServerName: " & objItem.ServerName
Wscript.Echo "Shared: " & objItem.Shared
Wscript.Echo "ShareName: " & objItem.ShareName
Wscript.Echo "Status: " & objItem.Status
Next
________________
The script was built with script-o-matic except I added -- Where
ServerName='\\print_server'") -- which I am pretty sure is the correct
syntax. Of course I substituted my real printer servers name for
\\print_server .
Any suggestions would be appreciated.
Ian Matthews
MCSE2001