dknight Posted May 8, 2012 Posted May 8, 2012 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. David
Chris-W- Posted May 8, 2012 Posted May 8, 2012 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 Next
daneil16 Posted October 9, 2014 Posted October 9, 2014 Just found this Microsoft reference for anyone else in a similar position https://gallery.technet.microsoft.com/Remove-All-Network-Printers-8b82b324 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now