How to Deploy Network Printer via Intune

In this article, We will discuss how we can install a network printer and its drivers using Intune. We will use PowerShell to install printer drivers and create a new printer with its network IP.  If you have a printer server installed with a DNS name then we can use a device configuration profile to install the printer which is quite simple and we will discuss this in another post.

 1- Create a folder to keep all Printer drivers and scripts in one place.

Intune Printer

2- Copy Printer drivers in Driver folder, make sure you have .inf file

Printer Intune

3- Open the CMD file and make sure that you have an accurate PowerShell script file name

Intune Printer Batch file

@ECHO OFF

SET ThisScriptsDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptsDirectory%CannonC355i.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& ‘%PowerShellScriptPath%'”

PowerShell for Printer installation

4- Open the PowerShell file and make sure that you have made all changes highlighted in the script.

$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$DriverName = “Canon Generic Plus PCL6
$DriverPath = “$PSScriptRoot\Driver”
$DriverInf = “$PSScriptRoot\Driver\Cnp60MA64.INF
$portName = “10.2.x.x

$checkPortExists = Get-Printerport -Name $portname -ErrorAction SilentlyContinue

if (-not $checkPortExists) {

Add-PrinterPort -name $portName -PrinterHostAddress “10.2.x.x
}
cscript “C:\Windows\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs” -a -m “Canon Generic Plus PCL6” -h $DriverPath -i $PSScriptRoot\Driver\Cnp60MA64.INF
$printDriverExists = Get-PrinterDriver -name $DriverName -ErrorAction SilentlyContinue

if ($printDriverExists)
{
Add-Printer -Name “Cannon C355i” -PortName $portName -DriverName $DriverName
}
else
{
Write-Warning “Printer Driver not installed”
}

$DriverName – you can find in .inf file in Driver folder
$DriverInf – This is the filename for the .inf file which contains drivers
$portName & PrinterHost – This is the IP address of the network printer
Add-Printer – This is the name of the Printer which will appear on the PC.

5- Now create an Intune package using Intune Packaging App. (Change source path and destination folder path)

PS C:\IntuneAppsWinAppsUtil> .\IntuneWinAppUtil.exe

Please specify the source folder: C:\PPackage\Canon C355i\Final
Please specify the setup file: CannonC355i.cmd
Please specify the output folder: C:\PPackage\Canon C355i\Final
Do you want to specify catalog folder (Y/N)?N

This will create an Intune package file in the same folder where all other files exist.

Intune Printer deployment

Deploy Printer Using Intune

6- Login to https://endpoint.Microsoft.com and Select Apps

7- Select all Apps and Click to Add. Select App Type to “Windows app (Win32)”

Printer Windows App

8- Select App Package file created in step 5

Printer Intune Package
9- Add app information such as Name & Publisher

Intune Network Printer

10- Specify the commands to install and uninstall this app

Intune Printer Script

11- Select both OS system architecture and minimum OS to Windows 10 1607

Intune App Requirement

12- On detection rule, Select “Manually configure detection rules and Rule type Register”

Intune Printer Detection Rule

Key path is unique to each printer package, the highlighted name should be the same as mentioned in the script. 

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Cannon C355i

13– Assign to the group you want to deploy printer using Intune.

 

2 Comments
  1. Mil says

    Kudos! Work like charm.

    I have been looking for such a method to deploy printers for our users in a different site.
    We recently setup autopilot and are deploying the devices this way. The only thing I was struggling with, was how to deploy the printers and here I found this perfect solution.
    I was trying other methods like setting this up using the device configuration profile, this works but has some shortfalls.
    1. Printer installs with the model name and because we have a certain naming policy for our printers, this was not the ideal solution.
    2. This can only be assigned to group of user and devices and thats it. Coudn’t be made available through the apps.

    With this method, i am able to add the printer name and also make this available via the intune company portal .

    Thx again for this great article..

  2. Andrew says

    Thank you!! I was struggling with other methods I found to automate local IP printer installs (serverless) with Intune, and your article nailed it.

    The only thing I had to change was the last line in the .cmd file:
    PowerShell -NoProfile -ExecutionPolicy Bypass -Command .\CannonC355i.ps1

    After that it worked perfectly, and I’ve started deploying this to my customers.

Leave A Reply

Your email address will not be published.