SubnetJO
Guest
|
Posted:
Wed Jan 05, 2005 4:45 am Post subject:
RE: Deleting printer from P&F without printer on network |
|
|
| Quote: | print server it had with it). Am I going to have to manually delete this
printer from ~100 computers?
|
Yes... I'm afraid.
I suppose you have checked the DeviceID of the printer.
The error means that no item was selected by your query, against the cimv2
database.
So, no printer with deviceid "\\fiery e650\print" was found.
Try this:
1]
Run this script (cscript better) on a client of yours, logged on WITH END
USER CREDENTIALS.
----------------------------------------
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from
Win32_Printer")
For Each objPrinter in colInstalledPrinters
wscript.echo "DeviceID = " & objprinter.deviceid
Next
----------------------------------------------
If your printer is listed, check the deviceID you use in your script.
Must be the same.
Take care about the case of the letters!
2]
If you printer is not listed at all, always with the end user credentials,
try to connect the printer with the script below:
-------------------------------------
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\ServerName\PrinterShareName"
-------------------------------------
If the connection works, I hope it will "overwrite" the existing one.
Now you'll surely find you printer listed by the script shown in the step
"1]" and you can delete it with your script.
There could be other reasons regarding the coomputer configuration, because
your script doesn't work, but I cannot know the enviroment...
I hope this can help.
Bye,
SubnetJO
Italy |
|