Forum Discussion
ABill1
Oct 12, 2023Iron Contributor
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" $drive...
- Oct 16, 2023Seems 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?
Philn88
Copper Contributor
I've got the same issue... The pnputil.exe command works fine when running manually through powershell but failed when deploy through Intune packaged as Win32.
In my environment where my Windows 10 devices do not have C:\Windows\SysNative\pnputil.exe. The folder SysNative doesn't exist at all.
In my environment where my Windows 10 devices do not have C:\Windows\SysNative\pnputil.exe. The folder SysNative doesn't exist at all.
Oct 24, 2023
You can find more info about sysnative here: https://call4cloud.nl/2021/05/the-sysnative-witch-project/
and how you can test it from your own device, as looking at that folder with your regular powershell session isn't going to work... as that powershell session is.... how many bits?
and how you can test it from your own device, as looking at that folder with your regular powershell session isn't going to work... as that powershell session is.... how many bits?
- Oct 24, 2023I use it in my script (See my blog post link above) like this where I try all the pnputil paths 😉
#Add all printer drivers by scanning for the .inf files and installing them using pnputil.exe
$infs = Get-ChildItem -Path . -Filter "*.inf" -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Fullname
$totalnumberofinfs = $infs.Count
$currentnumber = 1
Write-Host ("[Install printer driver(s)]`n") -ForegroundColor Green
Foreach ($inf in $infs) {
Write-Host ("[{0}/{1}] Adding inf file {2}" -f $currentnumber, $totalnumberofinfs, $inf) -ForegroundColor Green
try {
c:\windows\sysnative\Pnputil.exe /a $inf | Out-Null
}
catch {
try {
c:\windows\system32\Pnputil.exe /a $inf | Out-Null
}
catch {
C:\Windows\SysWOW64\pnputil.exe /a $inf | Out-Null
}
}
$currentnumber++
} - Philn88Oct 24, 2023Copper ContributorThanks, will take a look at SysNative info.
The PS script containing C:\Windows\SysNative\pnputil.exe /add-driver "$psscriptroot\Drivers\eSf6u.inf" /install
works when running it manually but not through Intune. I guess when Win32 calls pnputil.exe it redirects to SysWOW64 where it does not exist.
Is there another way to add the printer driver into the Windows Driver store without using pnputil.exe?