Niklas Blog

Exploring Device Management.

Mastering app Installation visibility with Microsoft Intune

31 December 2023

Mastering app Installation visibility with Microsoft Intune. Dive into ServiceUI and User notifications

In the realm of Modern Work Solutions, smooth application deployment is a crucial aspect of ensuring a seamless user experience. However, there are situations where you need to bridge the gap between the Windows System context (Session 0) and the User context (Session 1) to interact with users during an app installation, such as closing conflicting apps. In this blog post, we will explore how to accomplish this with the help of the ServiceUI.exe tool, PowerShellAppDeploymentToolkit, and Microsoft Intune.

Why Display from System to User Context?

Imagine you’re rolling out a critical application via Microsoft Intune. The installation process involves system-level operations that shouldn’t be interrupted, but you also need user interaction, perhaps to close other apps that might interfere with the installation.

As you can see when checking in Task Manager there are some tasks running in Session 0 for the system and some in Session 1 for the current user:

Here’s where the challenge arises:

How can you notify and interact with the user in Session 1 while the installation is running in the System Context in Session 0?

And how can we use this in Microsoft Intune when settings the Install behavior to System?

The Solution: ServiceUI.exe and PowerShellAppDeploymentToolkit

ServiceUI.exe, a tool from the Microsoft Deployment Toolkit, comes to the rescue. It allows you to display messages or notifications from Session 0 (System) to Session 1 (User). By combining this tool with PowerShellAppDeploymentToolkit (PSADT) and Microsoft Intune, you can deploy apps in the System Context while sending installation prompts and notifications to the user in a user-friendly manner.

Here’s a step-by-step guide on how to make this happen:

  • Prepare Your App Package: Ensure your application package is compatible with PSADT for effective deployment. You can package the app in any wrapper solution or use for example PSADT.
  • Integrate ServiceUI.exe: Incorporate the ServiceUI.exe tool into your deployment package. You can download it as part of the Microsoft Deployment Toolkit: https://www.microsoft.com/en-us/download/details.aspx?id=54259

Once you have MDT downloaded and installed on your device you will find the „ServiceUI.exe“ within „C:\Program Files\Microsoft Deployment Toolkit\Templates\Distribution\Tools\x64\“.

Calling the ServiceUI.exe manually will tell you which parameters it supports:

I am using explorer.exe in thisexample because it exists in every user session. This enables ServiceUI to detect the end-user session and allow it to interact with it from our System context.

  • Add ServiceUI.exe to your package: I always add the ServiceUI.exe tool in my PSADT root-folder to include it to my .INTUNEWIN packages:

  • Deploy via Microsoft Intune: Deploy your application package through Microsoft Intune, ensuring it runs in the System Context. The PSADT script will take care of bridging the communication gap between Session 0 and Session 1.

So we need to call our Installer, in this example the Deploy-Application.exe from PSADT with ServiceUI. This should look like this and you need to replace INSTALLER with your Setup-App or Script:

ServiceUI.exe -process:explorer.exe INSTALLER

In the Microsoft Intune portal you need to modify the Install command:

Now once the app installation on any assigned device starts it will display everything that your installer pops-up and it will be redirected to the user session through ServiceUI. So if you for example included the task to close any app in PSADT as a PRE-INSTALL command it will display this message in the user session and the user can interact with it.

Conclusion

In the world of Modern Work Solutions, the ability to seamlessly deploy applications is essential. Bridging the gap between the System and User contexts during app installations is made possible by tools like ServiceUI.exe, PowerShellAppDeploymentToolkit, and Microsoft Intune. ServiceUI.exe serves as a handy bridge to ensure effective communication with users during installation without compromising the integrity of system-level tasks.

By following the steps outlined in this post, you can simplify the deployment process, notify users when their input is required, and close with a successful app installation. ServiceUI.exe is indeed a valuable tool in your arsenal, enabling you to overcome the challenges of dealing with System and User contexts, ensuring a flawless user experience even during complex app installations.