Forum Discussion
deploying printer via intune
Hello everyone,
I'm in need of assistance with the following script I'm currently using: powershell
# Replace the placeholders with your details
$inf_path = ".\driver\KOBxxK__01.inf"
$driver_name = "KONICA MINOLTA Universal V4 PCL"
$driver_path = "C:\Windows\System32\DriverStore\FileRepository\KOBxxK__01.inf"
$printer_name = "Konica 1"
$port_name = “USED MY IP”
$printer_ip_address = “USED MY IP”
# Install the driver using Pnputil
pnputil.exe /add-driver "$inf_path"
# Add the printer driver using Add-PrinterDriver
Add-PrinterDriver -Name "$driver_name" -InfPath "$driver_path"
# Add the printer port using Add-PrinterPort
Add-PrinterPort -Name "$port_name" -PrinterHostAddress "$printer_ip_address"
# Add the printer using Add-Printer
Add-Printer -DriverName "$driver_name" -Name "$printer_name" -PortName "$port_name"
My objective is to remotely install a Konica printer via Intune using PowerShell. However, I've been unable to get this script to function properly. I placed this script in the folder located before the "Driver" folder.
The error
Could someone please assist me with this issue?
- Seems ok if you copy all the files in a folder on a test machine (Or Windows Sandbox) and run install.cmd as Administrator... Does that work?
- rahuljindal-MVPBronze ContributorMaybe this can help - https://rahuljindalmyit.blogspot.com/2021/01/intune-configure-printers-for-non.html
- ABill1Iron Contributor
This worked if I run the script locally but via intune I get this error:
Any ideas?
Aran
1. I would make sure (if you are going to package this in a win32app) that you are using sysnative..
2. add /install after the /add-driver (as shown below)
3. you don't need to specify the inf path if you already installed it.
https://call4cloud.nl/2021/07/what-about-printer-drivers/
###################
#Staging Drivers #
###################
C:\Windows\SysNative\pnputil.exe /add-driver "$psscriptroot\Drivers\eSf6u.inf" /install
#######################
#Installing Drivers #
#######################
Add-PrinterDriver -Name $drivername