How to remove shared printers from all users system

Jim 301 Reputation points
2024-07-25T17:49:01.48+00:00

OldServer = Server 2012. 3 printers shared from the server. Mapped manually by the users

NewServer = Server 2022. 2 printers. Mapped via GPO to the users.

Problem:

All users have the 3 printers mapped to their systems from the OldServer. I have removed the shares from the server, but they still exist on the users laptops (Windows 11), along with the new NewServer printers. They keep picking the OldServer printers to print and the job fails.

How can I remove the OldServer queues from all the user's computers?

Can't us GPO because they were not added via GPO.

Can't use the registry as it is way too dangerous complex to muck with.

Cannot find a way to do it with PowerShell.

Am I relegated to sending out instructions on how to manually remove them?

Thank you.

Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
689 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Walvin Salas 0 Reputation points Microsoft Employee
    2024-07-25T22:13:35.22+00:00

    You should be able to script it with remove-printer commands for PowerShell

    The most efficient way to do so is by getting the printers first then name checking and deleting the ones you specify.

    $printers = Get-Printer  
    
    # Change the following to the actual printer names:
    $printerNames = @("Printer1", "Printer2", "Printer3")
    
    # Check if the name matches any of the printer:
    foreach ($printer in $printers) {
    
    if ($printer.Name -in $printerNames) {
    
        #Delete the printer
    
        Remove-Printer -Name $printer.Name
    
    }
    }
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.