Solved

Script to remove certain printers

Posted on 2014-12-02
5
99 Views
Last Modified: 2014-12-04
Dear Experts,

I have tried using scripts so that a user can run to automatically remove certain printers.

Our current installed printers are IP printers and they all start with the same 3 letter code but the 4th character changes.

Is there a script that can be executed in order to remove a printer or printers?

Thank you in advance
0
Comment
Question by:IATA-techops
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:valmatic
ID: 40476189
here you go
https://www.interworks.com/blogs/smatlock/2014/03/31/using-logon-scripts-add-and-remove-network-printers

Just because this site calls it a logon script does not mean it can't be used in general it certainly can be run manually etc...
0
 

Author Comment

by:IATA-techops
ID: 40477110
Still unable to run it

From this code: I only want to remove printers from a local machine.

I have removed the Add printer part and added my server name, however receive a character error.

My server name is mia-fs2     and the printer is mia-61, could you tell me where i should enter this info correctly so the script can execute?

 set objNetwork = CreateObject(“WScript.Network”)
objNetwork.RemovePrinterConnection “\\Your_print_server\printer_name_being_removed”
objNetwork.AddWindowsPrinterConnection “\\Your_print_server\printer_name_being_added”
0
 

Author Comment

by:IATA-techops
ID: 40478356
?
0
 
LVL 7

Accepted Solution

by:
valmatic earned 500 total points
ID: 40480480
a local machine is a little different like so...
http://community.spiceworks.com/scripts/show/1612-delete-one-local-printer
0
 

Author Closing Comment

by:IATA-techops
ID: 40480868
n/a
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I recently purchased an HP EliteBook 2540p notebook/laptop. It has two video ports on it – VGA and DisplayPort. HP offers an optional docking station for the 2540p that also has both a VGA port and a DisplayPort. There are numerous online reports do…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now