GRitchie Posted November 17, 2015 Posted November 17, 2015 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.
DavetheITguy Posted November 17, 2015 Posted November 17, 2015 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. 1
GRitchie Posted November 17, 2015 Author Posted November 17, 2015 So rather than using 'deploy with GPO' you use a script to manually deploy it. That way you can run the remove all command beforehand?
DavetheITguy Posted November 17, 2015 Posted November 17, 2015 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.
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