After reading a question on the Technet community about how to deploy printers with a printer driver to Azure Ad joined devices, I realized I only created a blog about the wonderful Microsoft Universal Cloud Print solution! So here we go!
Of course, transforming to a modern workplace will also mean you need to do something with your existing Print solution. One of the best solutions would probably be to start using the Microsoft Universal Print solution. In one of my first blogs I was telling you how you could configure this and what my wishes were for this fantastic product:
But what, if you don’t have the possibility to migrate your printers to this solution right away? I know how it works! A customer calls and he/she suddenly wants to deploy a new printer to all of their devices and they don’t want to hear they need to move their printers to cloud-based solutions first. So what can you do? Telling the customer: No No?
The best option would be to install the printer first and arrange a meeting with the customer to urge them to move their printers to a cloud based solution.
So for now the printer has to be installed. Are we letting the customer do this manually as I showed you in this blog?
Or are we going to make sure the Printer and drivers are installed without any user interaction?
1.Installing The Printer
Step 1: Download the driver
In this example, I want to deploy a Toshiba printer, so I downloaded the Universal printer drivers from Toshiba first and placed them inside the folder c:intunetoshiba
After the zip file finished downloading, I extracted the whole zip file to start searching for the correct folder with the *.inf file in it. After I found the correct folder.
I moved this folder to the c:intunetoshiba root folder
And renamed it to something with less characters.. like drivers? I guess that name says it all.
Step 2: Creating the Install script
Before we can create the installation script we need to have some additional information. So please search for the *.inf file in this folder and open it!
We need to have the exact printer driver name. As shown above, it was an easy find! So let’s build the install.ps1 PowerShell script
C:WindowsSysNativepnputil.exe /add-driver "$psscriptrootDriverseSf6u.inf" /install Add-PrinterDriver -Name "TOSHIBA Universal Printer 2" Add-PrinterPort -Name "192.168.40.251" -PrinterHostAddress "192.168.40.251" Add-Printer "Toshiba Hoofdkantoor" -DriverName "TOSHIBA Universal Printer 2" -PortName "192.168.40.251"
Did you notice the Sysnative? If you want to read all about this, please read this blog:
And of course, we need to specify a nice uninstall.ps1, that’s going to be a lot easier!
remove-printerPort -Name "192.168.40.251" remove-printers "Toshiba Hoofdkantoor"
3. Creating the Intunewinapp and configure it in Intune
Now we have everything we need, we need to create the intunewinapp, so download the tool and zip it like shown below:
When we have created the intunewinapp we still need to publish it. To do so, open Intune and start creating a new Win32 app with the settings I show below:
Of course, we need to specify detection rules. We need to make sure when the printer is not installed it will be installed. The best method would be to choose a registry detection rule. But how do we know what key we must use? That’s easy… just open the registry and browse to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPrintPrinters
You will notice all printers are listed here. We can use the same value as we configured in the install.ps1 as printername
Assign the win32app to the correct users/groups/devices as required (or available if you want the let the end-user install the printer themselves when they really need it )
After the Win32 App finished installing, we notice a new printer has been installed. Let’s check it out!
Looking at the printer port, it has the proper tcp ip port attached to it
And of course it has exact the same printer driver which we specified to be installed!
Of course, we don’t want every page to be printed in colour, so change the colour setting to $false to make sure you will save some money.
I also disable the duplex option and specify the paper size in this example. You can add this part to the end of the install.ps1 script to make sure the printer settings are changed when the printer is installed.
Set-PrintConfiguration -PrinterName “Toshiba hoofdkantoor” -PaperSize A4 -color $false -duplexingmode onesided
When migrating to a full based cloud solution you will need to migrate your printer solutions also. Microsoft Universal Print should be your end goal but in the meantime, you could take a few baby steps and make sure some printers are still installed when necessary.