DEV Community

DeviceManager
DeviceManager

Posted on

Interactive installation with the InTune Win32 app

Backgrouond

Win32 apps are often used when distributing apps using Intune.
Unfortunately, Intune cannot be installed without silent installation.
It would be nice if all apps were installed silently, but in reality there are many cases where this is not the case.
After a lot of research, I found that there are people in overseas communities who are having the same problem, and the following countermeasures have been published.

Use ServiceUI with Intune to Bring SYSTEM Process to Interactive Mode

Isn't there a way other than ServiceUI? I thought, and I suddenly thought that I could do the same thing with psexec? I tried it and it worked, so I'm writing an article.

I think that it can be used for those who are in trouble because they cannot install interactively with Intune's Win32 application distribution, or for temporary support until creating a silent installation package.

About psexec

I will omit the explanation about psexec, but it is a tool published by MS. You may use it when you want the process to run under the System account.

Image description

You can use the -i command line option to interact with the specified session.

In the installation command when executing app distribution with intune,

psexec.exe -i /accepteula

By doing so, I think that you can connect the screen to the user's session ID while executing the installation command with the System account.

Example(7-zip)

I'll try it right away, prepare 7-Zip to be distributed with PSAppDeployToolkit, and put the above psexec in the installation command to achieve interactive installation.

I will also omit the explanation about PSAppDepolyToolkit, but it is a collection of helper scripts that you want to have such functions when distributing applications with SCCM or Intune. It's hard to make by myself, so I'm grateful that something like this is open to the public.

PSAppDeployToolkit

File Structure

The source file folder looks like this:

Image description
Place the installation files under Files.
This time it will be like this.

Image description

Install Script

In the INSTALLATION section write like this.
Acquire the session ID of the logged-in user on the first line (acquire the session ID of Explorer.exe)
The second line uses psexec to actually execute the installation command.



$sid=(Get-Process -Name explorer).SessionId
Execute-Process -Path "$dirFiles\PsExec.exe" -Parameters "-i $sid /accepteula $dirFiles\7z1900-x64.exe" -WindowStyle 'Normal'


Enter fullscreen mode Exit fullscreen mode

I have the actual file here.

Deploy-Application.ps1

Building IntunWin file

Under this folder I kept a set of PSAppdeploy files.
D:\Documents\Intune\Apptest01\Toolkit

The IntuneWin file for uploading was created as follows.

Image description

Intune Setting

The Install command can be left as it is PSAppDeployTookit.
Silent is attached, but this is an instruction for PSAppDeployTookit, so the actual installer screen is displayed.

Image description

Test Installation result

Image description

Image description

The installer screen of 7Zip was displayed properly.

Image description

It completed normally.

Image description

Image description

There is no need to make 7Zip interactive, but it seems to be useful for things that require more complicated installations, and for printer drivers and other interactive applications.

Closing

If you think about it, the problem is that you can't do this with Intune in the first place. I posted it on the MS Feedback site, so if you agree, please vote.

Ability to allow Win32 Application(System context) Interactive installation

Enjoy your Intune life!

Top comments (2)

Collapse
 
michele_ariis_677b5dc84bd profile image
Michele Ariis

Hi, I tried with a printer monitoring app; the problem is that it is installed however according to enterprise portal no; do you know what it could be?

Collapse
 
michele_ariis_677b5dc84bd profile image
Michele Ariis

Ok, after a synchronization of the corporate portal, it seems to see it as installed; I tried to run uninstall but it doesn't run; I would like to iteratively remove the application here as well.