Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to Log, Remove and install Back same network Printers.

Status
Not open for further replies.

Seaborg

MIS
Jul 29, 2014
1
PL
Hi Scritping Lads.
I`m involved in project to Reduce paper usage in my company ;)
And to do so we have Enabled Duplex printing on each printer. But to changes got apply for all PC we need to Delet priner and install it back to pull new Defoult settings.
doing it manualy could be time conuming ... 10 Printer over 400 workstations.
I sow some Scritps to Remove printers but i cant find any to do all tasks that are required :]
I will be pushing that thrue SCCM.

Any Ideas how i can dill with that?
 
Untested but this should do the trick
Code:
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WSHPrinters = WSHNetwork.EnumPrinterConnections
For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
	If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
	  WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
	  WSHNetwork.AddWindowsPrinterConnection WSHPrinters.Item(LOOP_COUNTER +1)
	End If
Next

I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top