Installing local network printer to group of laptops via intune

Anonymous
2021-10-08T08:05:28.513+00:00

0

I am planning to install a printer which is in office to a group of laptops via intune. I have made the .intunewin package with the prep tool. I have also modified the powershell scripts and install commands based on location info (IP address, printer name, drivers)

This is the Install command:

@ECHO OFF  
  
SET ThisScriptsDirectory=%~dp0  
SET PowerShellScriptPath=%ThisScriptsDirectory%RicohC3004.ps1  
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'"  

And here is the Powershell:

$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition  
$DriverName = "RICOHAficio_MP_C3300FB98"  
$DriverPath = "$PSScriptRoot\Driver"  
$DriverInf = "$PSScriptRoot\Driver\r4600.INF"  
$portName = "**************"  
  
$checkPortExists = Get-Printerport -Name $portname -ErrorAction SilentlyContinue  
  
if (-not $checkPortExists) {  
  
Add-PrinterPort -name $portName -PrinterHostAddress "*********"  
}  
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs" -a -m "RICOHAficio_MP_C3300FB98" -h $DriverPath -i $PSScriptRoot\Driver\r4600.inf  
$printDriverExists = Get-PrinterDriver -name $DriverName -ErrorAction SilentlyContinue  
  
if ($printDriverExists)  
{  
Add-Printer -Name "Ricoh" -PortName $portName -DriverName $DriverName  
}  
else  
{  
Write-Warning "Printer Driver not installed"  
}  

The installation is succesful but the detection script brings me error. I get an error code 0x87D1041C. I use registry editor path as detection rule. The path goes like this:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Ricoh

Can you please help me? Am I doing something wrong with the detection rule?

Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,789 questions
Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
910 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,692 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rahul Jindal [MVP] 9,556 Reputation points MVP
    2021-10-08T22:13:01.173+00:00
    0 comments No comments