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