HP Universal PCL print driver - silent install with Intune

30 views
Skip to first unread message

William Hamilton

unread,
Jul 27, 2026, 10:57:30 PM (4 days ago) Jul 27
to techies-f...@googlegroups.com
kia ora, anyone have a working install.ps1 and detection script for an HP Universal printer drivers?  I have a school setting up PaperCut and they are having issues pushing out printer drivers to WIndows devices.  

I have pushed out PaperCut but it is not pulling down the drivers. Therefore, we need to manually install them so that PC can create the queues.  A quick test of install.ps1 gives me security popups asking about trusting HP which may be why the install is not working automagically via Intune. Fortunately, all of the MacBooks are fine :)

tia

W

Matt Strickland

unread,
Jul 27, 2026, 11:59:12 PM (4 days ago) Jul 27
to Techies for schools
I do, mines a package that I make mandatory for teacher/student owned devices. (and runs as part of autopilot)... it was from Ben Whitmore but I hashed it a bit, this works for our Fujifilms.
This is packaged with the driver into an intunewin file.

<#
.Synopsis
Created on:   07/02/2026
Created by:   Matt Strickland
Filename:     Install-Driver.ps1

Modified script from Ben Whitmore (Install-Printer.ps1 on 31/12/2021) to only install a printer driver.

#### Win32 app Commands ####

Install:
powershell.exe -executionpolicy bypass -file .\Install-Driver.ps1 -DriverName "FF Multi-model Print Driver 2" -INFFile "ff6daie.inf"

Uninstall:
powershell.exe -executionpolicy bypass -file .\Remove-Driver.ps1 -DriverName "FF Multi-model Print Driver 2"

Detection:
Registry: Example HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\FF Multi-model Print Driver 2

.Example
.\Install-Driver.ps1 -DriverName "FF Multi-model Print Driver 2" -INFFile "ff6daie.inf"

#>

[CmdletBinding()]
Param (
    [Parameter(Mandatory = $True)]
    [String]$DriverName,
    [Parameter(Mandatory = $True)]
    [String]$INFFile
)

#Reset Error catching variable
$Throwbad = $Null

#Run script in 64bit PowerShell to enumerate correct path for pnputil
If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") {
    Try {
        &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH -DriverName $DriverName -INFFile $INFFile
    }
    Catch {
        Write-Error "Failed to start $PSCOMMANDPATH"
        Write-Warning "$($_.Exception.Message)"
        $Throwbad = $True
    }
}

function Write-LogEntry {
    param (
        [parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [string]$Value,
        [parameter(Mandatory = $false)]
        [ValidateNotNullOrEmpty()]
        [string]$FileName = "$($INFFile)-Driver.log",
        [switch]$Stamp
    )

    #Build Log File appending System Date/Time to output
    $LogFile = Join-Path -Path $env:SystemRoot -ChildPath $("Temp\$FileName")
    $Time = -join @((Get-Date -Format "HH:mm:ss.fff"), " ", (Get-WmiObject -Class Win32_TimeZone | Select-Object -ExpandProperty Bias))
    $Date = (Get-Date -Format "MM-dd-yyyy")

    If ($Stamp) {
        $LogText = "<$($Value)> <time=""$($Time)"" date=""$($Date)"">"
    }
    else {
        $LogText = "$($Value)"  
    }

    Try {
        Out-File -InputObject $LogText -Append -NoClobber -Encoding Default -FilePath $LogFile -ErrorAction Stop
    }
    Catch [System.Exception] {
        Write-Warning -Message "Unable to add log entry to $LogFile.log file. Error message at line $($_.InvocationInfo.ScriptLineNumber): $($_.Exception.Message)"
    }
}

Write-LogEntry -Value "##################################"
Write-LogEntry -Stamp -Value "Installation started"
Write-LogEntry -Value "##################################"
Write-LogEntry -Value "Install Driver using the following values..."
Write-LogEntry -Value "Driver Name: $DriverName"
Write-LogEntry -Value "INF File: $INFFile"

$INFARGS = @(
    "/add-driver"
    "$INFFile"
)

If (-not $ThrowBad) {

    Try {

        #Stage driver to driver store
        Write-LogEntry -Stamp -Value "Staging Driver to Windows Driver Store using INF ""$($INFFile)"""
        Write-LogEntry -Stamp -Value "Running command: Start-Process pnputil.exe -ArgumentList $($INFARGS) -wait -passthru"
        Start-Process pnputil.exe -ArgumentList $INFARGS -wait -passthru

    }
    Catch {
        Write-Warning "Error staging driver to Driver Store"
        Write-Warning "$($_.Exception.Message)"
        Write-LogEntry -Stamp -Value "Error staging driver to Driver Store"
        Write-LogEntry -Stamp -Value "$($_.Exception)"
        $ThrowBad = $True
    }
}

If (-not $ThrowBad) {
    Try {
   
        #Install driver
        $DriverExist = Get-PrinterDriver -Name $DriverName -ErrorAction SilentlyContinue
        if (-not $DriverExist) {
            Write-LogEntry -Stamp -Value "Adding Printer Driver ""$($DriverName)"""
            Add-PrinterDriver -Name $DriverName -Confirm:$false
        }
        else {
            Write-LogEntry -Stamp -Value "Print Driver ""$($DriverName)"" already exists. Attempt to replace or update it."
            Write-LogEntry -Stamp -Value "Adding Printer Driver ""$($DriverName)"""
            Add-PrinterDriver -Name $DriverName -Confirm:$false
        }
    }
    Catch {
        Write-Warning "Error installing Printer Driver"
        Write-Warning "$($_.Exception.Message)"
        Write-LogEntry -Stamp -Value "Error installing Printer Driver"
        Write-LogEntry -Stamp -Value "$($_.Exception)"
        $ThrowBad = $True
    }
}

If ($ThrowBad) {
    Write-Error "An error was thrown during installation. Installation failed. Refer to the log file in %temp% for details"
    Write-LogEntry -Stamp -Value "Installation Failed"
}

Matt Strickland

unread,
Jul 28, 2026, 12:05:57 AM (4 days ago) Jul 28
to Techies for schools
I should add sorry that's just the driver as its part of autopilot for any new device (I've extracted the driver, but should work work for HP Uni I would have thought)

Maybe some ai could assist here.

I follow-up with a remediation script to actually add the printers to devices, this is currently for a local print server via kerberos.
I do have individual printer scripts but here is an example of my school one for the printers students need (Detect-SharedPrinters.ps1, Remediate-SharedPrinters.ps1)

# Detect-SharedPrinters.ps1
$PrintServer = "print.yourschool.local"
$PrinterList = @("Library", "SocialSciences", "VA1")

function Normalize-PrinterName {
    param (
        [string]$Name
    )
    return ($Name -replace ' ', '')
}

$installedPrinters = Get-Printer
$missingPrinters = @()

foreach ($PrinterName in $PrinterList) {
    $PrinterPath = "\\$PrintServer\$PrinterName"

    $existingPrinter = $installedPrinters | Where-Object {
        (Normalize-PrinterName $_.Name) -eq (Normalize-PrinterName $PrinterPath)
    } | Select-Object -First 1

    if (-not $existingPrinter) {
        $missingPrinters += $PrinterPath
    }
}

if ($missingPrinters.Count -gt 0) {
    Write-Output "Missing printers: $($missingPrinters -join ', ')"
    exit 1
}
else {
    Write-Output "All required printers are installed."
    exit 0
}

---------------------------------------------


# Remediate-SharedPrinters.ps1
$PrintServer = "print.yourschool.local"
$PrinterList = @("Library", "SocialSciences", "VA1")

$spoolerRestartRequired = $false

function Normalize-PrinterName {
    param (
        [string]$Name
    )
    return ($Name -replace ' ', '')
}

foreach ($PrinterName in $PrinterList) {
    $PrinterPath = "\\$PrintServer\$PrinterName"

    $existingPrinter = Get-Printer | Where-Object {
        (Normalize-PrinterName $_.Name) -eq (Normalize-PrinterName $PrinterPath)
    } | Select-Object -First 1

    if (-not $existingPrinter) {
        Write-Output "Printer not found, adding: $PrinterPath"
        Start-Process rundll32.exe -ArgumentList "printui.dll,PrintUIEntry /ga /n`"$PrinterPath`" /q" -Wait
        $spoolerRestartRequired = $true
    }
    else {
        Write-Output "Printer already installed: $($existingPrinter.Name)"
    }
}

if ($spoolerRestartRequired) {
    Write-Output "Restarting Print Spooler to commit changes..."
    Stop-Service -Name "Spooler" -Force
    Start-Service -Name "Spooler"
    Start-Sleep -Seconds 5
    Write-Output "Print Spooler restarted."
}
else {
    Write-Output "No printer changes required."
}

exit 0

Marlon Yu

unread,
Jul 28, 2026, 4:40:23 AM (4 days ago) Jul 28
to techies-f...@googlegroups.com

Hi William,

 

Not exactly what you are asking for but we’ve been using Papercut’s Print Deploy feature to make it easier to deploy printers and drivers to clients. We made the move several years ago when there was an issue where Microsoft started requiring print drivers to have admin rights to install. Once the initial print queues are cloned, pretty easy to deploy printers.

 

Marlon

 

From: techies-f...@googlegroups.com <techies-f...@googlegroups.com> On Behalf Of William Hamilton
Sent: Tuesday, July 28, 2026 2:57 PM
To: techies-f...@googlegroups.com
Subject: [techies-for-schools] HP Universal PCL print driver - silent install with Intune

 

CAUTION: This email originated from outside of Rangitoto College. Be careful about clicking on links or opening attachments. If in doubt, ask IT.

 

--
You received this message because you are subscribed to the Google Groups "Techies for schools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to techies-for-sch...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/techies-for-schools/CAAjujspOc4aM%3DLZ6SXg3Z2FcGJNXcdrd%2B56EitqLp8i%3D-1%3DJEw%40mail.gmail.com.

William Hamilton

unread,
Jul 28, 2026, 4:49:10 AM (4 days ago) Jul 28
to techies-f...@googlegroups.com
Thanks Matt, I will have a proper read in the morning. I appreciate the great response(s)!

W

--
You received this message because you are subscribed to the Google Groups "Techies for schools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to techies-for-sch...@googlegroups.com.

William Hamilton

unread,
Jul 28, 2026, 4:50:35 AM (4 days ago) Jul 28
to techies-f...@googlegroups.com
Thanks Marlon, I will check the page out. I know that the print supplier created queues and had issues pulling down drivers for some reason. I wonder if they were using PrintDeploy or if that is the magic answer for this school. :)


cheers

W


Simon Wright

unread,
Jul 28, 2026, 5:14:50 AM (4 days ago) Jul 28
to techies-f...@googlegroups.com
I second print deploy, use it for staff, pushed out via intune.
Use mobility print for students. 



Simon.



DISCLAIMER
This e-mail is intended for the addressee only and may contain information which is subject to legal privilege. This e-mail message and accompanying data may contain information that is confidential and subject to privilege. Its contents are not necessarily the official view Otago Boys’ High School or communication of the Otago Boys’ High School. If you are not the intended recipient you must not use, disclose, copy or distribute this e-mail or any information in, or attached to it. If you have received this e-mail in error, please contact the sender immediately or return the original message to Otago Boys’ High School by e-mail, and destroy any copies. Otago Boys’ High School does not accept any liability for changes made to this e-mail or attachments after sending.

Stephen Caustick

unread,
Jul 28, 2026, 5:28:41 PM (4 days ago) Jul 28
to techies-f...@googlegroups.com
We use Print Deploy and it works well. Pushed out to all device (just staff in our case) via InTune. 

Nga mihi

Stephen Caustick

IT Technician

Hastings Boys' High School

(06) 8730365 ex 847

step...@hastingsboys.school.nz


IT Support Requests
Please email all IT requests to Help...@hastingsboys.school.nz.
This ensures a support ticket is created, and your request is tracked and prioritized correctly.

Requests not logged via the Helpdesk may experience delays.

Please do not SMS or call my mobile.
Use 3CX for all internal phone calls.




 


From: techies-f...@googlegroups.com <techies-f...@googlegroups.com> on behalf of Simon Wright <simon....@obhs.school.nz>
Sent: Tuesday, July 28, 2026 9:14 PM
To: techies-f...@googlegroups.com <techies-f...@googlegroups.com>
Subject: Re: [techies-for-schools] HP Universal PCL print driver - silent install with Intune
 

Matt Strickland

unread,
Jul 28, 2026, 5:45:52 PM (4 days ago) Jul 28
to Techies for schools
And yes print deploy is another option if you intend to keep Papercut & Mobility print for students (that don't need fancy booklet etc).
Just have a mac on the go too to push out those queues.

We are probably more looking at papercut hive & mobility going on a smaller nuc or suchlike once most things in the rack are collapsed.

For now I ensure the native driver is pushed as system via intune, the queues work well for Mac & PC with Kerberos SSO.

Matt

William Hamilton

unread,
Jul 29, 2026, 2:36:52 AM (3 days ago) Jul 29
to techies-f...@googlegroups.com
Thanks for the responses.  I may need to add that it is PaperCut Hive that the school has been sold, and there are no onsite servers in place.  I hope to be on site this week and will have a better look at the driver situation.

cheers all

W

Simon Wright

unread,
Jul 29, 2026, 2:40:25 AM (3 days ago) Jul 29
to techies-f...@googlegroups.com
Doesnt hive use its own universal print driver?
Curious to know how hive goes. 


Simon

William Hamilton

unread,
Jul 29, 2026, 2:52:48 AM (3 days ago) Jul 29
to techies-f...@googlegroups.com
We manually installed drivers on a few office machines so that they could start using the fancy new printers, and Hive seems to do the job fine.  The Macs, deployed using Jamf School, are working fine.  The main sales pitch was that the office admin/principal would have a single unified usage report to review. The 'print and collect anywhere sounds nice but none of the teachers so far are all that fussed about it.   As a primary school there are currently no student printing offerings, nor are there any staff iPad printing offerings.   Should be easy, right? :)

I have received a couple of comments stating that when printing to the "colour queue", the job turned out black and white, BUT later was fine and printed in colour.  There have been issues printing some downloaded files from Canva that would not print in colour, I have seen similar issues with files from Twinkle but have yet to confirm the issue at this school and find out the facts.

A very long way of saying, Hive looks fine for this small school, once we work out the driver issue :)

W

Reply all
Reply to author
Forward
0 new messages