← Back to Microsoft Intune
✍️ Blog Post · Microsoft Intune

Deploying HP Printer via Intune — Step-by-Step Guide

Driver installation, Win32 app packaging, and install/uninstall/detection PowerShell scripts.

✍️ TheiTnotesguy
📅 May 15, 2025
8 min read
ℹ️
One app per printer: Create a separate Intune Win32 app for each printer model/IP combination. This gives you granular targeting and makes troubleshooting much easier.
01
Download & Test the Printer Driver
Download the model-specific driver from HP support. Install manually and confirm a test print succeeds. Note the exact driver name you'll need later.
02
Extract the Driver Package & Find Driver Name
Extract the ZIP. Open the .INF file and search for the driver code (e.g. 0x00337) to get the exact display name — e.g. "HP Universal Printing PS". You need the exact string for the scripts.
03
Create install.ps1
This script adds the driver to the Windows driver store, creates a TCP/IP port, and adds the printer.
$PrinterName = "HP Color LaserJet MFP E78625" $PrinterIP = "192.168.10.28" $PortName = "IP_$PrinterIP" $DriverName = "HP Universal Printing PS" $DriverArgs = @("/add-driver",".\*.inf","/install","/subdirs") Start-Process pnputil.exe -ArgumentList $DriverArgs -Wait Add-PrinterDriver -Name $DriverName -Confirm:$false Add-PrinterPort -Name $PortName -PrinterHostAddress $PrinterIP -Confirm:$false Add-Printer -Name $PrinterName -DriverName $DriverName -PortName $PortName -Confirm:$false
04
Create uninstall.ps1
Removes the printer and TCP/IP port cleanly from the device.
$PrinterName = "HP Color LaserJet MFP E78625" $PortName = "IP_192.168.10.28" Remove-Printer -Name $PrinterName -Confirm:$false Remove-PrinterPort -Name $PortName -Confirm:$false
05
Create detection.ps1
Returns exit 0 if the printer exists (detected = installed), exit 1 if not. Intune uses this to determine deployment state.
$PrinterName = "HP Color LaserJet MFP E78625" Get-Printer -Name $PrinterName
06
Package with IntuneWinAppUtil
Copy all scripts into the driver folder. Package using Microsoft's Win32 Content Prep Tool:
# Download: https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool IntuneWinAppUtil.exe -c .\HPDriver\ -s install.ps1 -o .\output\
07
Create Win32 App in Intune and Deploy
Intune → Apps → Windows → Add → Windows app (Win32). Upload the .intunewin file. Set the install/uninstall commands below and assign to the target group.
# Install command: %SystemRoot%\SysNative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File .\install.ps1 # Uninstall command: %SystemRoot%\SysNative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File .\uninstall.ps1
💡
Detection rule: Set detection method to Custom script and use your detection.ps1. Do not use file or registry detection for printers — the script method is the most reliable.