Jump to content

Recommended Posts

Posted

Morning

Is it possible to run a GPO/script on login that removes every printer on the machine and then adds one from GPO (print server, deploy printer).

 

I've got a VB script which removes all the PCs on the machine, but it requires running as admin.

Posted

Use this one, it's a powershell script that can be used during log off, logon, shutdown etc via GPO...... "Get-WMIObject Win32_Printer | where{$_.Network -eq ‘true’} | foreach{$_.delete()}"

 

remove the quotes when you save this as a .ps1 file. I have a share on the print server which I use to map my printer scripts.

  • Thanks 1
Posted

You would use group policy. GPME > Computer Configuration > Windows Settings > Scripts > Startup or Shutdown (Right Click >Properties) > Powershell Scripts.

 

Or to remove printers when a user logs off ..... User Configuration > Windows Settings > Scripts > Logon or Logoff (Right Click >Properties) > Powershell Scripts.

 

Hope this helps.

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...