Remove Printer options from 'Printers & Scanners' via InTune Platform Powershell Script

Dan Appleby 1 Reputation point
2025-09-12T15:06:48.0766667+00:00

I'm going to try this again, as my last post got "deleted for violating guidelines",

I need to know exactly, how I remove old stale UP Printer entries from the Windows Settings app via a powershell script deployed via InTunes Platform Scripts.

The powershell script runs perfectly fine when run locally. However, running via the IME module on user login (Script runs in user context) the printers do not remove at all. Nothing works.

Please advise how I run this script to remove stale Universal Print entries from 60 endpoints via InTune Platform Scripts.

Windows for business | Windows 365 Business
0 comments No comments

1 answer

Sort by: Most helpful
  1. Harry Phan 28,615 Reputation points Independent Advisor
    2025-09-12T18:30:55.52+00:00

    Dear Dan Appleby,

    We understand that your script works as expected when run locally, but fails to remove printers when deployed via Intune’s Platform Scripts in user context. This is a known limitation, as Universal Print queues are tied to the user profile and may require elevated permissions or specific timing during login to be successfully removed.

    To improve reliability, we recommend deploying the script as a Win32 app using the Intune Win32 Content Prep Tool, configured to run in system context with a scheduled task that triggers at user logon. This approach allows the script to execute with elevated privileges while still targeting user-specific printer entries.

    Additionally, ensure the script includes logic to enumerate and remove printers using Remove-Printer or registry-based cleanup under HKCU:\Printers\Connections, depending on how the UP entries were provisioned. You may also need to delay execution slightly after login to ensure the user session is fully initialized.

    Warm regards,

    Harry Phan

    Was this answer helpful?

    0 comments No comments

Your answer

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