HI
(1)copy below powershell command in notepad and rename it as"removepdfprint" then change the extension to .ps1 like picture1 .
Remove-Printer -Name "Microsoft Print to PDF"
(2)copy the removepdfprint.ps1 to netlogon shared folder on DC
(3)create a "removepdfprint" gpo and link it to destination OU and create below shutdown domain policy like picture 2
Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown)
and add \\19dc\netlogon\removepdfprint.ps1 in powershell scripts like picture 3
(4) enter gpupdate /force on both client and DC then reboot client computers then check the result on client computers
refer "How to assign computer shutdown scripts" in below link
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn789196(v=ws.11)#:~:text=user%20logon%20scripts-,To%20assign%20user%20logon%20scripts,Scripts%20(Logon%2FLogoff).
Best Regards
Andy YOU
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.