Call4Cloud | MMP-C | Autopilot | Device Preparation

The Amazing PSADT

Patch My Pc | install & update thousands of apps

This short blog will show you how you could start creating a new Win32 app and making it interactive with the user’s context by using the wonderful PowerShell App Deployment Toolkit (PSADT)

I will divide this blog into multiple parts

1. Introduction

When packaging apps, sometimes you don’t have the option to do a silent install; sometimes, you must decide to let end-users install them on their own. In one of my older blogs about the Company Portal, I showed you that when installing a Win32 app from the Company Portal app, the app will be installed in the System context.

Because the app will be installed in the System context, it won’t be easy to show those prompts in the user context. You could open the task manager and look at the Session-Id as a good example. As shown below, the Intune Management Extension is running in Session ID 0, and the normal user processes are running in Session Id 1

Luckily, using Serviceui.exe and PSADT (AKA: the PowerShell App Deployment Toolkit), you can bring the installation process from the System context (0) to Interactive mode.

But with great power comes great responsibility. Because everything is done in “System context“. So please, pretty please, be careful! I am explaining it in Part 2 of this blog.

Using the PSADT in combination with Serviceui.exe is perfect for software that needs user interaction. For example, The Brother software deployrequires the user to connect the USB scanner…

Another good example would be if you must warn the end-user that he/she needs to close the App before the installation can continue.

2. Creating a PSADT package

In the introduction, I mentioned the Brother Scanner software as a good example of when you need to use PSADT. Let’s take a look at how you could do the same for other programs that can’t be installed silently:

creating the PSADT package and using serviceui.exe
  • Downloading the Powershell app Deployment Toolkit and unzip it to c:\packages\brother
  • Downloaded the Brother software and extract the files to c:\packages\brother\files
  • You will need to change some settings in the deployment-application.ps1. As shown below, you will need to change the variables application and most important, you will need to change the installation task:  Execute-Process -Path “$dirFiles\setup.exe”)
changing the deployment-application.ps1 from the powershell app deployment toolkit (PSADT) and making sure it executes setup,exe
  • Now we have everything we need we need to create a new Intunewin package. You can specify the install file/parameter: deploy-application.exe and folder: c:\packages\brother
  • To start deploying the app, upload the Win32 app to Intune and specify this install command: .\ServiceUI.exe -Process:explorer.exe Deploy-Application.exe. With this installation parameter we are using(-Procss:explorer.exe) we are making sure we are going to determine if the process “explorer.exe” is running and by doing this we are making sure if there is a logged on user. If there is a user logged on (explorer.exe) ServiceUI.exe will launch Deploy-Application.exe to show the dialogs to the user,

Conclusion

Deploying Apps with the company portal is great, and with the use of PSADT, you could also bring a nice interactive prompt to the user context when there is no silent install option available! Now you have the power to do some amazing things!

Amazing Things Spiderman GIF - Amazing Things Spiderman Cameo - Discover &  Share GIFs

3 thoughts on “The Amazing PSADT

  1. seems like the problem with this is or at least what I observed over Intune is that it will then not install until there actually is a user on because serviceui errors out.

Leave a Reply

Your email address will not be published. Required fields are marked *

48  +    =  54

Proudly powered by WordPress | Theme: Wanderz Blog by Crimson Themes.