Jump to content

Recommended Posts

Posted

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

Posted

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

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...