Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Remove network printer

Trying to remove a printer installed from a printer server.  Using the following in the only step in the package:

%WINDIR%\System32\Printui.exe /gd /q /n"\\Server_Name\Third Floor b/w letterhead HP 4050"
NET STOP SPOOLER
NET START SPOOLER

 

The package runs without error but the printer is never removed.

Tried running as the Deploy User or the Logged in User.  Makes no difference.

0

Comments

4 comments
Date Votes
  • Powershell:

    Get-Printer | Where-object $_.Name -Like "Third Floor b/w letterhead HP 4050"  } | Remove-Printer
    0
  • These workstations are Windows 7 with Powershell 2.  Get-Printer won't work.

    0
  • Well step one should be to install Powershell 5 then! 

    But in all seriousness:

    Get-WMIObject win32_Printer | Where {$_.Name -like '*Third floor b/w letter*' } | Foreach-Object {$_.Delete() }
    0
  • Hi Stephen,

    I've tried running your script locally and it works.  However, I cannot get it to work through PDQ Deploy.  Would you be able to help?

    0