Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install-Printer.ps1 Suddenly not working #75

Open
JustoStyle opened this issue Jun 28, 2024 · 4 comments
Open

Install-Printer.ps1 Suddenly not working #75

JustoStyle opened this issue Jun 28, 2024 · 4 comments

Comments

@JustoStyle
Copy link

Have deployed many of printers with this script but myself and anther coleege are having a issue with the script now where it produces this in the log file

##################################
<time="15:29:04.648 570" date="06-28-2024">
##################################
Install Printer using the following values...
Port Name: IP_10.86.1.53
Printer IP: 10.86.1.53
Printer Name: Unley - Sharp MX-3070V
Driver Name: SHARP MX-3070V PCL6
INF File: su0emenu.inf
<Staging Driver to Windows Driver Store using INF "su0emenu.inf"> <time="15:29:04.827 570" date="06-28-2024">
<Running command: Start-Process pnputil.exe -ArgumentList /add-driver su0emenu.inf -wait -passthru> <time="15:29:04.849 570" date="06-28-2024">
<time="15:29:04.970 570" date="06-28-2024">
<System.InvalidOperationException: This command cannot be run due to the error: The system cannot find the file specified.
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)> <time="15:29:04.995 570" date="06-28-2024">
<time="15:29:05.079 570" date="06-28-2024">

and this in the event log.
image

It seems that the install cant find the INF file but i have checked and even decrypted the intunewin to check and the file is in there. Anyone else seen this it seems like an issue with intune deployment in general but posting there to see if anyone is able to assist.

Thank you,
J

@krilumino
Copy link

What is the path of the .inf file, relative to the directory where install-printer.ps1 (or pnputil) is being called from?

@JustoStyle
Copy link
Author

Everything is in the root of the intunewim.

@krilumino
Copy link

<System.InvalidOperationException: This command cannot be run due to the error: The system cannot find the file specified. at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)>

This is generated by powershell when start-process isn't able to find an executable. It seems like it isn't finding pnputil.exe when it tries to start the process. Does your $env:path contain "C:\windows\system32"?

Consider adding 'write-log $env:path' to install-printer.ps1 before it tries to launch pnputil, so you know what's in it under the executing user's context (should be SYSTEM when run as device from Intune apps).

Does it work before packaging the .intunewin? What's the full powershell command calling install-printer.ps1?
What happens if you try to run pnputil manually? Does it successfully add it to the driver store?

pnputil.exe /add-driver su0emenu.inf

@JustoStyle
Copy link
Author

Running the script in its folder that gets packed into the wim. Runs fine the only thing i have noticed has started happening is it being up a box to trust the pusblisher of then driver.

Something seems to have change as if i upload a know working intunewim it no longer works and throws the cant find file path error above.

So maybe its something with how the intunewim is getting unpacked for new intunewims only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants