Deploy a Printer with RMM
Table of Contents
INTRO
If there’s one thing probably both IT professionals and users most likely have in common, it’s distain for printers. You would think by now everyone would be working on going paperless but apparently the trees aren’t worth the trouble, so we’re stuck with them. Installing printers in Windows has pretty much been the same since Windows Vista but for some reason people keep asking us to install them.
Printers are installed under the User Profile so when you install a printer for one user it doesn’t carry over to the rest of the users. However, in this guide since Datto RMM runs commands under SYSTEM, the printer installed will appear to all User Profiles in Windows.
PREPARING THE DRIVER PACKAGE
In this example, the printer I am installing is a Brother MFC-L3770CDW series printer. The driver can be downloaded here. You want to download the package titled, “Add Printer Wizard Driver”. Once downloaded I am presented with a file called, “Y17E_C1-hostm-D1.exe” which when ran extracts everything to a folder called “gdi” in the same directory. This directory will contain several .inf driver files for the printer. You will need to open each one with notepad to see which will be the correct one we push to computers for TCP/IP use.
In this case, look for the “Function” section near the top for help with some of them. There is a .inf file for just USB use, a scanner driver for USB/LAN use, and lastly a PlugAndPlay driver, which is the one we want which is named, “BRPRC17A.inf”. You will also need to record the correct name of the “DriverName” used in the .inf for the printer model you’re installing, in my case, a “Brother MFC-L3770CDW series” printer. If you do not do this, the script will not work and fail on port creation.
Now that we know the correct driver’s name and the file for installing for TCP/IP port use, you will need to create .ZIP archive of the driver files. You can’t just copy the .inf driver as it also has a corresponding .cat file needed for it, and also any other files that are in the folder needed for install. So, I create an archive of everything. You will then need to think about where you will extract the files on the remote Windows host as the script will be pointing to them.
POWERSHELL SCRIPT
Datto RMM will download the archive we created, PowerShell will then extract it, add the driver to the Windows Driver Repository, add a Printer Port that maps to the IP address of the printer, install the printer driver from the Windows Driver Repository via the DriverName in the .inf we recorded and use the correct path for that name, and then finally add the printer and map the driver and port together.
$ExecutingScriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
New-Item -Path 'C:\TEMP' -ItemType Directory
Expand-Archive -LiteralPath "$ExecutingScriptDirectory\Brother MFC-L3770CDW series.zip" -DestinationPath "C:\TEMP\Brother MFC-L3770CDW series"
PnPUtil /Add-Driver "C:\TEMP\Brother MFC-L3770CDW series\BRPRC17A.INF" /Install
Add-PrinterPort -Name "10.0.1.254_IP" -PrinterHostAddress "10.0.1.254"
Get-WindowsDriver -All -Online | Where-Object {$_.OriginalFileName -like '*BRPRC17A.INF'} | Select-Object -ExpandProperty OriginalFileName -OutVariable InfPath
Get-Content -Path $InfPath
Add-PrinterDriver -Name "Brother MFC-L3770CDW series" -InfPath $InfPath
Get-PrinterDriver
Add-Printer -DriverName "Brother MFC-L3770CDW series" -Name "Brother MFC-L3770CDW series" -PortName "10.0.1.254_IP"
CONCLUSION
Well, that’s about it. Remember, once installed all user accounts will be able to see it since it’s installed with SYSTEM permissions. I have used this method to deploy various models and brands of printers. When a user calls-in asking for a printer, I just deploy the job in Datto RMM and it’s done in minutes, I don’t even need to remote on and bother the user. It’s just done and works. It has saved me a lot of time and I hope it can for you as well!
My name is Dex Sandel, author at WinReflection, a blog which aims to help others on various IT and Christian related subjects. DON’T TREAD ON ME! The best is yet to come, and nothing can stop what’s coming!
You all have a greater destiny in Christ, should you choose to ‘follow’ Him, not just believe. Many of you feel lost, without drive, and lack a greater purpose in your life causing depression, sadness, anxiety, and loneliness. Working your 9-5 job isn’t your primary purpose. So, then what is? That’s for you to discover, but hopefully I can provide some new unlocks along your path.
What will ‘you’ do, and what will your destiny be?
John 3:16: For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
Leave a Reply
Want to join the discussion?Feel free to contribute!