Scripts Thread, Script to delete network printers at logoff? in Coding and Web Development; I'm looking for a reliable script to delete all network printers when a user logs off. Our users have roaming ...
8th May 2012, 11:32 AM #1
- Rep Power
Script to delete network printers at logoff?
I'm looking for a reliable script to delete all network printers when a user logs off. Our users have roaming profiles and are currently picking up printers from every room they log into.
We are running Server 2008 r2/Win7 and printers are being deployed by Print Management.
Any help would be greatly appreciated.
8th May 2012, 12:11 PM #2
- Rep Power
We use vbscript to remove printers on logon, not sure if you could integrate the code with a shutdown script:
Set wshNetwork = CreateObject("WScript.Network")
on Error Resume Next
'Deletes all network printers
Set clPrinters = WshNetwork.EnumPrinterConnections
On Error Resume Next
For i = 0 to clPrinters.Count - 1 Step 2
wshNetwork.RemovePrinterConnection clPrinters.Item(i+1), true
By woody in forum Windows
Last Post: 15th February 2013, 03:28 PM
By jgcracknell in forum Scripts
Last Post: 14th December 2009, 11:43 AM
By _Bat_ in forum Windows
Last Post: 25th February 2009, 10:50 AM
By woody in forum Scripts
Last Post: 27th November 2005, 11:41 PM
By tosca925 in forum Scripts
Last Post: 31st August 2005, 08:45 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)