question

Beginner-8391 avatar image
0 Votes"
Beginner-8391 asked RahulJindal-2267 answered

Installing local network printer to group of laptops via intune

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?





mem-intune-generalmem-intune-device-configurationsmem-intune-application-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RahulJindal-2267 avatar image
0 Votes"
RahulJindal-2267 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.