How to Prompt Users Before Intune App Updates with PSADT

Prompt users before Intune app updates: Microsoft MVP article by Nicklas Olsen. The PSADT welcome dialog asks the user to close Google Chrome before it updates, with Close Apps & Install and Defer buttons and 3 deferrals left.

Getting an app update out through Microsoft Intune doesn’t take much, but getting it out without disrupting the people halfway through using that app takes a bit more thought. Win32 apps are installed silently in the background, and if the application happens to be open when the installation runs, one of two things usually happens: the installation fails, or the application is closed without warning and the user loses whatever they were working on.

If you want to give users a heads-up and a say in when the update happens, the options are limited. You can either schedule deployments outside working hours and hope the devices are online and the application is closed, or you can wrap each application in PSADT and script the dialog prompts yourself. The first relies on a fair bit of luck, and the second means maintaining even more lines of PowerShell per application, which is too time-consuming!

Below, I’ll show you how Robopack and PSADT dialog prompts let you ask users to close an app before it updates, and let them defer the update, without writing a script for each application.

Wrapping applications in PSADT manually

PSADT (the PowerShell App Deployment Toolkit) is a framework that makes packaging applications a lot easier, even if you’re not an expert in scripting.

The user interaction is defined in the Invoke-AppDeployToolkit.ps1 script. For example, a pre-installation step that asks the user to close Google Chrome and allows three deferrals looks like this:

Show-ADTInstallationWelcome -CloseProcesses chrome -AllowDefer -DeferTimes 3

This works fine for one app, but it becomes a problem when you have more than a handful, because every application that shows a dialog prompt needs its own lines of PowerShell and process names, and all of it must be tested.

PSADT dialog prompts in Robopack

Robopack wraps your applications in PSADT for you, so there’s no script to write per application. Instead, you configure the prompts in two places. The script template defines how the prompts behave and which dialog prompts are shown, while the app setting is configured per application and holds the process names that must be closed before the installation can continue.

Setting up PSADT dialog prompts

Script template

In this example, I’ll configure the prompts for Google Chrome, so users are asked to close Chrome before it is updated and can defer the update up to three times.

  1. Before I can configure the app setting, I need to create a new script template in Robopack. Go to Settings > Script templates > Add new template.
The Script templates page under Settings in Robopack, listing PSAppDeployToolkit v4.1.8 and PSADT 3.10.2 templates with their options, and the Add new template button highlighted under Actions.
  1. Unfold the dialog options. This is where you choose which prompts to show: the welcome, progress and install complete dialogs. For this example, I’ll use the welcome dialog.
The script template editor in Robopack with the dialog options unfolded: the welcome dialog is set to show on install, only if there are apps to close, with deferral allowed three times. Progress and install complete dialogs are off.
  1. Enable Show on install, Only show if there are apps to close and Allow deferral, and set Defer times to 3. Because the dialog only appears when there are apps to close, anyone who doesn’t have Chrome open isn’t interrupted.
  2. Save the changes, and the template is ready.

App setting

With the script template in place, I can now create an app setting specifically for Chrome.

  1. Go to App settings > Add App setting.
The App settings page in Robopack with the Add App setting button highlighted.
  1. In Target app, select Google Chrome, and add the process name under Apps to close. For Chrome, the process name is chrome.
A new app setting in Robopack with Google Chrome as the target app and chrome added under Apps to close.
  1. When you’re done, click Save settings. The application is now ready to be deployed.

Before you deploy the application, you can check the script to confirm that the app setting has been added. In this example, Robopack has added the code for the welcome dialog to the pre-install section:

## Below 1 command(s) added by Robopack
If (Get-Process @('chrome') -ErrorAction Ignore) {
    Show-ADTInstallationWelcome -CloseProcesses @{ Name='chrome' } -AllowDefer -DeferTimes 3 -MinimizeWindows
}
Else {
    Write-ADTLogEntry "Target processes are not running, skipping Welcome Dialog."
}

What the user sees

When the update runs on the device and Chrome is open, the user gets the prompt below. They can close Chrome and install the update right away, or defer it. The dialog also shows how many deferrals they have left.

The PSADT welcome dialog on a Windows 11 desktop, asking the user to save their work because Google Chrome (chrome.exe) will be closed, with 3 remaining deferrals and the buttons Close Apps & Install and Defer.

If you want to confirm it works, the log in C:\Windows\Logs\Software also shows that the process was detected and that the prompt was shown to the user.

The PSADT log for the Chrome installation: the user has 3 deferrals remaining, chrome is detected as running, and the user is prompted to close Google Chrome.

Next steps

Once the script template is saved, adding another app is just a case of creating an app setting and entering its process names. The time you’d normally spend scripting and testing prompts for each application goes back into your week. I’ve only used the welcome dialog here, but the same template can also show the progress and install complete dialogs if you want to keep users in the loop during and after the install.

You can try it in your own tenant with a free trial, or if you’d prefer to test it away from your production environment first, try the Robopack sandbox.

Share this article

Nicklas Olsen

About the author

Principal Cloud, Robopack

Microsoft MVP

Nicklas Olsen is a Principal Cloud & Endpoint Consultant at Robopack, based in Aalborg, Denmark. He is one of the youngest Microsoft MVPs in endpoint management and has held the award for more than three years.

Nicklas trained as an IT infrastructure technician and was a Gold Microsoft Learn Student Ambassador, part of Microsoft’s global programme for students who help their peers build technical skills. In 2023, he launched learnintune.net, a blog for students and beginners getting started with Intune, with hands-on scenarios that let readers practise what they’ve learned. Nicklas has spoken at events across Europe and the US, where his sessions focus on endpoint management and Microsoft Intune.

Leave a comment

Your email address will not be published. Comments are reviewed before they appear. See our privacy policy.