I'm migrating from older Group Policy–deployed printers to Group Policy Preferences and need to remove existing print-server printer connections from both computer and user contexts. Some printers were configured through Group Policy Preferences, while others use the older deployed-printer method. Computer-context removal works with rundll32 PrintUIEntry, but user-context queues often return Access Denied or hide the Remove option. What PowerShell or Group Policy approach can reliably clean up these old network printer connections so the new policies can take over?
4 Answers
For printers installed in the user context, run the cleanup as a logon script in user context. For example: Get-Printer | Where-Object {$_.Type -eq 'Connection'} | Remove-Printer -Confirm:$false. A computer or SYSTEM script only sees that computer account’s printer connections, not each user’s profile.
You can also create a Group Policy Preferences printer item with the action set to Delete. Put the delete actions before the policies that create or update the replacement queues, and choose whether it should run once or at every logon. Running it in the correct user or computer context is important.
A less disruptive migration is to deploy the replacement queues under clearly different names, such as a color or revised queue name, and leave the old queues in place temporarily. Once the new policies are confirmed, remove the old queues with a user-context logon script or targeted Group Policy Preferences delete action. This avoids breaking printing for everyone at once.
If you want to target only network connections, use Get-Printer and filter on Type or PortName. For example: Get-Printer | Where-Object {$_.Type -eq 'Connection'} | Remove-Printer -Confirm:$false. If the queues use predictable TCP/IP port names, remove matching ports afterward with Get-PrinterPort and Remove-PrinterPort. Be careful not to delete local printers accidentally.
I’m mainly dealing with print-server connections, so filtering by Type should be safer than removing every printer. I’ll test the cleanup with the replacement policies disabled first.

That explains the Access Denied behavior I was seeing. The old queues were deployed for users, so I’ll need to run the removal in their logon context rather than only as SYSTEM.