Forum Discussion
dob126
Jan 22, 2023Copper Contributor
Printers not automatically provisioned after remove
Hello Community. I have a problem with Universal Print and I suspect it has to do with the fact that I removed the printer once. I have a policy, this applies to my Azure Virtual Desktops use...
pedinopa
Jan 30, 2024Copper Contributor
I have faced many of the same issues and found many things that work sometimes. Typically what happens is remnances of the printer are left behind either in the registry or in the control panel. Recently I put a script in Intune which has to be run by the end user from company portal (as the printer installs in the user context and the univ printer checks the user permissions to the printer). So my script does 2 things
1. deletes the UPPRINTERINSTALLS registry key (this is where the published univ printer installs.
2. removes the printer
write-host "Removing Universal printregistry key"
Remove-Item HKCU:\Software\Microsoft\PrinterProvisioning\UPPrinterInstalls -Recurse
Function Printer-Cleanup() {
param (
[parameter(Mandatory=$true)]
$printers = $name
)
ForEach ($Printer in $Printers) {
$SecurePrint = get-printer | where {$_.name -eq $Printer}
if ($SecurePrint)
{
write-host "Removing $Printer"
get-printer | where {($_.name -eq $Printer) } | Remove-Printer
}
else
{
write-host "$Printer was not found"
}
}
}
printer-cleanup "Printer"
1. deletes the UPPRINTERINSTALLS registry key (this is where the published univ printer installs.
2. removes the printer
write-host "Removing Universal printregistry key"
Remove-Item HKCU:\Software\Microsoft\PrinterProvisioning\UPPrinterInstalls -Recurse
Function Printer-Cleanup() {
param (
[parameter(Mandatory=$true)]
$printers = $name
)
ForEach ($Printer in $Printers) {
$SecurePrint = get-printer | where {$_.name -eq $Printer}
if ($SecurePrint)
{
write-host "Removing $Printer"
get-printer | where {($_.name -eq $Printer) } | Remove-Printer
}
else
{
write-host "$Printer was not found"
}
}
}
printer-cleanup "Printer"