Jump to content

Recommended Posts

Posted

I usually leave the printers installed an the print server and set the deploying GPP to delete.

 

You could also set the gpp to just delete all shared printers - but it depends how you deploy them (shared / tcp-ip etc)

 

I’d think the GPP would be able to remove GPO deployed printers - but I don’t use that method so couldn’t say 100%

  • Thanks 1
Posted

Im just testing things out at the moment. I have a feeling it is goingto be a long day!

 

At first the printers were coming back, but I've deleted them from the GPO, and off the servers printer list itself.

 

Going to test if that has worked.

 

Wouldnt mind seeing your script if you have it as may need something if things fail to work.

 

 

Thankyou.

Posted

This VB Script will remove all shared printers.

 

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _

("Select * From Win32_Printer Where Network = True")

For Each objPrinter in colInstalledPrinters

objPrinter.Delete_

Next

  • Thanks 1
Posted

Try this.

 

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & strComputer & "\root\cimv2")

 

Set colInstalledPrinters = objWMIService.ExecQuery _

("Select * From Win32_Printer Where Network = True")

For Each objPrinter in colInstalledPrinters

objPrinter.Delete_

Next

Posted

It’s been a long day so I apologise if I’m doing this wrong.

I’ve copied that into notepad and saved as Remove printers.vbs

 

And then just double clicked that and it just throws an error at me.

 

Should I be doing this another way?

Thankyou.

Posted
It’s been a long day so I apologise if I’m doing this wrong.

I’ve copied that into notepad and saved as Remove printers.vbs

 

And then just double clicked that and it just throws an error at me.

 

Should I be doing this another way?

Thankyou.

 

There is an issue copying and pasting the text to and from the post. I've just tried it myself and I get the same error, but the original file works fine. I've wrapped it in

 to see if that makes a difference. I can also send a plain text file if you prefer. 

[code]strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _
   ("Select * From Win32_Printer Where Network = True")
For Each objPrinter in colInstalledPrinters
   objPrinter.Delete_
Next

Posted
Sorry, me again.

 

This only works with admin users. Is there a way to ake it run for all users?

 

 

Thankyou.

 

The best option would be to set in a GPO as a start-up script, it will then run with admin privileges.

Posted

None of it worked.

 

I've decided to just start adding the new printers manually for the time being.

 

IS there something in the registry I can do locally to remove user sunwanted printers? I assume they wont come back as GPO no longer there on server.

Posted

We recently had an abolute nightmare where we had our printers refreshed but they kept the same name just different drivers etc. Users were mapping printers via GPO but it was picking up the old drivers and when you removed them they kept coming back etc. We found out by removing the registry on the computers fixed 50% of them, the others we had to re-image unfortunatly.

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl\SetControl\Print\Printers

 

You may need to stop the print spooler service when applying the fixes above.

  • Thanks 1

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