In this guide, we’ll explore how to publish a printer with specific drivers via Intune, allowing users to install it through the Company Portal via self-service. This method eliminates the need for a print server, making it a streamlined solution for organizations.
1. Preparing the Files
First, download the necessary printer drivers from the manufacturer's website. If the driver package is compressed, extract it to find the .inf
file, typically located in a subfolder. It’s advisable to keep all associated files in the same directory, as the .inf
file might reference other dependencies.
2. Creating the Installation Script
Create a PowerShell script, for example, Printer_Install.ps1
, with the following content:
# Path to print driver
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$driverPath = Join-Path $scriptPath "disk1\MPC2004_.inf"
# Install printer driver
Start-Process -FilePath "rundll32.exe" -ArgumentList "printui.dll,PrintUIEntry /ia /m \"RICOH MP C2004 PCL 6\" /h \"x64\" /v \"Type 3 - User Mode\" /f \"$driverPath\"" -NoNewWindow -Wait
# Create printer connection
$portName = "IP_192.168.10.145"
$printerName = "Ricoh MP C2004ex"
Add-PrinterPort -Name $portName -PrinterHostAddress "192.168.10.145"
# Add printer
Add-Printer -Name $printerName -DriverName "RICOH MP C2004 PCL 6" -PortName $portName
Script Customization
-
Driver Path:
Update$driverPath
with the correct subfolder and.inf
file path:$driverPath = Join-Path $scriptPath "disk1\MPC2004_.inf"
-
Driver Name:
Modify the driver name if necessary in theStart-Process
command:Start-Process -FilePath "rundll32.exe" -ArgumentList "printui.dll,PrintUIEntry /ia /m \"RICOH MP C2004 PCL 6\" /h \"x64\" /v \"Type 3 - User Mode\" /f \"$driverPath\"" -NoNewWindow -Wait
-
Port Name:
Define the printer's IP address in$portName
:$portName = "IP_192.168.10.145"
-
Printer Name:
Set the desired printer name in$printerName
:$printerName = "Ricoh MP C2004ex"
3. Packaging the Files
Place all necessary files in a single folder. For example:
PrinterPackage/
├─ Printer_Install.ps1
├─ disk1/
├─ MPC2004_.inf
├─ AdditionalDriverFiles...
Use the Microsoft Win32 Content Prep Tool to package the files:
IntuneWinAppUtil.exe -c <SourceFolderPath> -s Printer_Install.ps1 -o <OutputFolderPath>
4. Deploying via Intune
Upload the .intunewin
file to Intune as a Win32 App.
App Information
- Name: Printer: Ricoh MP C2004ex
- Publisher: Vision-Inside AG
- Logo: (Optional – Upload a printer icon for a polished look in the Company Portal)
Program Configuration
-
Install Command:
powershell.exe -ExecutionPolicy Bypass -File .\Printer_Install.ps1
-
Uninstall Command:
Remove-Printer -Name "Ricoh MP C2004ex"
Operating System Requirements
- Architecture: 32-bit / 64-bit
- Minimum OS: Windows 10 1607
Detection Rules
Use a custom detection script to verify if the printer is installed:
$printer = Get-Printer | Where-Object { $_.Name -eq "Ricoh MP C2004ex" }
$driver = Get-PrinterDriver | Where-Object { $_.Name -eq "RICOH MP C2004 PCL 6" }
if ($null -ne $printer -and $null -ne $driver) {
Write-Output "Found"
Exit 0
} else {
Write-Output "NotFound"
Exit 1
}
Assignments
Deploy the app to all enrolled devices or target specific user groups as needed.
With this approach, your users can easily install printers via self-service in the Company Portal, eliminating the need for a centralized print server. This streamlined process ensures greater flexibility and efficiency in managing printing solutions within your organization.