Run PSADT v4 as user-context and System

Hello All,

I have an application deployed via Intune that runs in the user context.
However, before this application runs, I need to execute another script (running in the system context) to create a firewall rule.

Is there a workaround to ensure that the script to create the firewall rule runs before the application starts, possibly using PSADT?

Thank you all

You’d use Start-ADTProcessAsUser, however it’s borked in v4.0.x. In the upcoming v4.1.0 release, it’s golden though. A pre-release instance can be obtained from here: - Strings are never null in PowerShell, so rework `Remove-ADTIniValue… · PSAppDeployToolkit/PSAppDeployToolkit@f185873 · GitHub

Thank you for the feedback

You can install the Intune application in the system context, create the firewall rule, and then install the actual application using “Start-ADTProcessAsUser.” (wait for v4.1 as mjr4077au suggested)

Alternatively, you can create two different Intune applications. Application 1 runs in system context and creates the firewall rule. Application 2 runs in user context and performs the app installation. You then deploy application 2 and define application 1 as a prerequisite for application 2.

yes, you are right.

Was the workaround i did while waiting for the version 4.1.0