4.1x User Interactivity Behavior

I'm trying to figure out how to re-create custom PSADT 3x interactive/noninteractive behavior in PSADT 4.1x.

In version 3.x we accounted for the following two scenarios:

  • When deploying an app as available using SCCM (PSADT would run in Interactive mode), we would check for running processes and present a dialog for the user to close them or defer installation (native PSADT functionality).

  • When deploying the same app as required using SCCM (PSADT would flip to NonInteractive mode). We had a block of code early in the deployment stage that would check for presence of running processes AND if deployment is NOT interactive. Under those conditions, deployment would exit with a fast retry code. SCCM would keep trying to install the app until such a time as running processes were no longer detected in memory.

The above configuration would allow us to prompt users for input, etc when they triggered an application install interactively, and to suppress dialogs when running the install as a required (noninteractive) deployment AND ensure that we don't terminate running applications which could cause data loss.

With PSADT 4.1x we're seeing the following behavior:

  • When deploying an application as available in SCCM (interactive), deployment behaves the same way as PSADT 3x.

  • When installing an application as required AND there is a logged on user present on the computer, PSADT flips to interactive install IF we're checking for running processes "AppProcessesToClose" OR if "NoProcessDetection" variable is set to $true.

I'm trying to figure out how one would go about forcing PSADT 4.1x to NOT change to interactive mode when deployed as a required install in SCCM but still retain the running process detection behavior when deployed interactively.

You will need to specify which version you are actually using. V4.1.x refers to 5 different versions and another one is on the way.

The specific patch release shouldn't matter too much in this instance.

Regarding the underlying requirement, I'm not too sure as 3.x didn't have any magic in it to detect whether you were deploying as a required app, etc.

I'm still trying to figure out what you want, sorry. The toolkit out of the box will go to Silent if there's either no users logged on, you're going through Autopilot, or you've got apps that need closing but they're not open. That last one is the new addition into v4.1 and is highly desirable.

Can you confirm again for me what you'd like to have happen here?

I looked at the code in the 3x toolkit (AppDeployToolkitMain.ps1) that determines which mode to run in:

## If script is running in session zero
If ($SessionZero) {
    ##  If the script was launched with deployment mode set to NonInteractive, then continue
    If ($deployMode -eq 'NonInteractive') {
        Write-Log -Message "Session 0 detected but deployment mode was manually set to [$deployMode]." -Source $appDeployToolkitName
    }
    Else {
        ##  If the process is not able to display a UI, enable NonInteractive mode
        If (-not $IsProcessUserInteractive) {
            $deployMode = 'NonInteractive'
            Write-Log -Message "Session 0 detected, process not running in user interactive mode; deployment mode set to [$deployMode]." -Source $appDeployToolkitName
        }
        Else {
            If (-not $usersLoggedOn) {
                $deployMode = 'NonInteractive'
                Write-Log -Message "Session 0 detected, process running in user interactive mode, no users logged in; deployment mode set to [$deployMode]." -Source $appDeployToolkitName
            }
            Else {
                Write-Log -Message 'Session 0 detected, process running in user interactive mode, user(s) logged in.' -Source $appDeployToolkitName
            }
        }
    }
}
Else {
    Write-Log -Message 'Session 0 not detected.' -Source $appDeployToolkitName
}

Based on that section, when I deploy an app as required via SCCM, session 0 is detected and process is not $IsProcessUserInteractive so PSADT flips to "NonInteractive" mode. Based on that behavior, I can then use the deployment mode to perform certain actions like checking for running processes and exiting if running processes are detected.

What I can't figure out is how to get this type of behavior using the 4.1x version of the toolkit.

As you've explained, 4.1x flips to interactive deployment mode under those 3 conditions:

The toolkit out of the box will go to Silent if there's either no users logged on, you're going through Autopilot, or you've got apps that need closing but they're not open.

But I'm wondering if it's possible to have 4.1.x behave in a similar way to 3.x by automatically flipping to noninteractive mode when being deployed by SCCM as "required". Regardless of whether there are logged on users or not.

Or if you were to look at it a different way, can the latest version of the toolkit provide a variable that can be used to detect an SCCM "required" deployment state. That functionality was effectively provided by the deployment state variable in the old toolkit, but not in the latest one.

I hope this makes sense.

NonInteractive and Silent were the same thing in v3, which made little sense, which is why we made NonInteractive be like a passive mode, showing UI elements that don't require responses, and changed the session zero stuff to switch to Silent if conditions matched.

The $IsProcessUserInteractive stuff has changed because it doesn't matter anymore, and we recommend disabling interactivity in ConfigMgr anyway for this purpose. All that matters when it comes to showing the UI is whether a user is logged on or not.

None of the above has any real bearing on whether the ConfigMgr app is required or assigned though.

That's fair.

So if we look at a practical use case, how would you handle the following scenario?

A piece of software requires a license. When this application is being installed by a user interactively by initiating the install from Software Center, I would like to present a prompt where they can enter the key which I will then pass to the installer.

If I push the application to a set of computers (that may have logged on users or not) I would like to suppress the prompt and instead pass a generic key.

In the past, based on the behavior of PSADTv3 in the latter case, I would simply test if $DeployMode -ine 'Interactive' and suppress the prompt.

Thank you.

Just do it the same way? $adtSession.DeployMode -ine 'Interactive'?

But if application is deployed as required using auto mode and logged on user(s) are detected, deployment will run as interactive and prompt logged on user to enter the license key, so checking whether deployment is interactive or not does not accomplish the desired goal compared to PSADTv3.

In sorry but I'm really not understanding the issue. Even v3 would still be Interactive. Can you please show me your v3 log file so I can see what it did?

Hi @applockerfail, just reaching out again regarding that 3.x log when run as a required app. I'm super keen to understand what was going on and resolve this one with you.

2 Likes

Thank you for following up.

I'll try to clarify.

ADTv3

In ADT 3 we define a variable in the Variables section of Deploy-Application.ps1:

[String[]]$appProcesses = @('notepad')

and then we have this code in the initialization section of Deploy-Application.ps1:

if (($DeployMode -ine 'Interactive') -and ($appProcesses)) {
        if ($null -ne (Get-Process -Name $appProcesses -ErrorAction SilentlyContinue)) {
            Write-Log -Message 'Conflicting applications were running, non interactive mode. Exiting.' -Severity 2 -Source $deployAppScriptFriendlyName
            Exit-Script -ExitCode 60012
        }
    }

This app is then uploaded to SCCM and deployed as:

  • required
  • as system
  • whether or not users are logged on

When this app is executed on the device when a user is logged on and the running process is detected as being open the following happens as shown in the log file:

<![LOG[[Initialization] :: *******************************************************************************]LOG]!><time="11:33:31.469-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: *******************************************************************************]LOG]!><time="11:33:31.469-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: [Test_Notepad_EN_01] setup started.]LOG]!><time="11:33:31.490-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Script [C:\Windows\ccmcache\j\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\j\Deploy-Application.ps1]]LOG]!><time="11:33:31.627-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Script [C:\Windows\ccmcache\j\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\j\AppDeployToolkit\AppDeployToolkitMain.ps1]]LOG]!><time="11:33:31.932-360" date="09-25-2025" component="PSAppDeployToolkitExt" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="AppDeployToolkitMain.ps1">
<![LOG[[Initialization] :: [Test_Notepad_EN_01] script version is [1.0.0]]LOG]!><time="11:33:32.183-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: [Test_Notepad_EN_01] script date is [XX/XX/20XX]]LOG]!><time="11:33:32.187-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: [Test_Notepad_EN_01] script author is [<author name>]]LOG]!><time="11:33:32.193-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: [Deploy Application] script version is [3.10.2]]LOG]!><time="11:33:32.197-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The following non-default parameters were passed to [Deploy Application]: [-DeploymentType:'install']]LOG]!><time="11:33:32.201-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: [App Deploy Toolkit Main] script version is [3.10.2]]LOG]!><time="11:33:32.205-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: [App Deploy Toolkit Extensions] version is [3.10.1]]LOG]!><time="11:33:32.209-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Computer Name is [VM-N1.DOMAIN.ca]]LOG]!><time="11:33:32.213-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Current User is [NT AUTHORITY\SYSTEM]]LOG]!><time="11:33:32.217-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: OS Version is [Microsoft Windows 11 Education 64-bit 10.0.26100.6584]]LOG]!><time="11:33:32.220-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: OS Type is [Workstation]]LOG]!><time="11:33:32.227-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Current Culture is [en-US], language is [EN] and UI language is [EN]]LOG]!><time="11:33:32.234-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Hardware Platform is [Virtual:Hyper-V]]LOG]!><time="11:33:32.267-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: PowerShell Host is [ConsoleHost] with version [5.1.26100.6584]]LOG]!><time="11:33:32.274-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: PowerShell Version is [5.1.26100.6584 x64]]LOG]!><time="11:33:32.279-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.42000]]LOG]!><time="11:33:32.282-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: *******************************************************************************]LOG]!><time="11:33:32.289-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Display session information for all logged on users: 


NTAccount           : DOMAIN\UserX
SID                 : S-1-5-21-1060284298-436374069-1708537768-133359
UserName            : alt421
DomainName          : DOMAIN
SessionId           : 2
SessionName         : 31C5CE94259D4006A9E4#0
ConnectState        : Active
IsCurrentSession    : False
IsConsoleSession    : False
IsActiveUserSession : True
IsUserSession       : True
IsRdpSession        : True
IsLocalAdmin        : False
LogonTime           : 9/25/2025 11:31:21 AM
IdleTime            : -00:06:35.3019081
DisconnectTime      : 
ClientName          : WS1
ClientProtocolType  : RDP
ClientDirectory     : C:\WINDOWS\system32\mstscax.dll
ClientBuildNumber   : 26100



]LOG]!><time="11:33:32.300-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The following users are logged on to the system: [DOMAIN\UserX].]LOG]!><time="11:33:32.304-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Current process is running under a system account [NT AUTHORITY\SYSTEM].]LOG]!><time="11:33:32.309-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: There is no console user logged in (user with control of physical monitor, keyboard, and mouse).]LOG]!><time="11:33:33.172-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The active logged on user is [DOMAIN\UserX].]LOG]!><time="11:33:34.647-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The active logged on user [DOMAIN\UserX] has a primary UI language of [EN].]LOG]!><time="11:33:34.743-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The following UI messages were imported from the config XML file: [UI_Messages_EN].]LOG]!><time="11:33:34.790-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The active logged on user [DOMAIN\UserX] has a DPI scale factor of [100] with DPI pixels [96].]LOG]!><time="11:33:35.431-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.]LOG]!><time="11:33:35.474-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Service [Schedule] exists.]LOG]!><time="11:33:35.896-360" date="09-25-2025" component="Test-ServiceExists" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Getting the service [Schedule] startup mode.]LOG]!><time="11:33:35.966-360" date="09-25-2025" component="Get-ServiceStartMode" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Service [Schedule] startup mode is set to [Automatic].]LOG]!><time="11:33:36.045-360" date="09-25-2025" component="Get-ServiceStartMode" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Getting the service object for service [Schedule].]LOG]!><time="11:33:36.225-360" date="09-25-2025" component="Start-ServiceAndDependencies" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Service [Schedule] with display name [Task Scheduler] has a status of [Running].]LOG]!><time="11:33:36.262-360" date="09-25-2025" component="Start-ServiceAndDependencies" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: The task scheduler service is in a healthy state: True.]LOG]!><time="11:33:36.412-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Session 0 detected, process not running in user interactive mode; deployment mode set to [NonInteractive].]LOG]!><time="11:33:36.455-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Installation is running in [NonInteractive] mode.]LOG]!><time="11:33:36.461-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Deployment type is [Installation].]LOG]!><time="11:33:36.467-360" date="09-25-2025" component="PSAppDeployToolkit" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Initialization] :: Conflicting applications were running, non interactive mode. Exiting.]LOG]!><time="11:33:36.488-360" date="09-25-2025" component="Deploy Application" context="NT AUTHORITY\SYSTEM" type="2" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Cleanup] :: Bypassing Close-InstallationProgress [Mode: NonInteractive]]LOG]!><time="11:33:36.517-360" date="09-25-2025" component="Close-InstallationProgress" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Cleanup] :: Test_Notepad_EN_01 Installation completed with exit code [60012].]LOG]!><time="11:33:36.526-360" date="09-25-2025" component="Exit-Script" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">
<![LOG[[Cleanup] :: -------------------------------------------------------------------------------]LOG]!><time="11:33:36.533-360" date="09-25-2025" component="Exit-Script" context="NT AUTHORITY\SYSTEM" type="1" thread="3272" file="Deploy-Application.ps1">

Even though user is logged on, session is run as "NonIneractive" and the custom code section forces the toolkit to exit as running processes are detected.

ADTv4.1

Now if I attempt the same in ADT 4.1.5, we see the following behavior:

I set the process to check for at the top of Invoke-AppDeployToolkit.ps1:

AppProcessesToClose = @('notepad')

Then in the pre-installation section I have the following code section:

if (($($adtSession.DeployMode) -ine 'Interactive') -and ($adtSession.AppProcessesToClose)) {
        if (Get-ADTRunningProcesses -ProcessObjects $adtSession.AppProcessesToClose) {
            Write-ADTLogEntry -Message "Conflicting applications were running, non interactive mode. Exiting." -Severity 2
            Close-ADTSession -ExitCode 1602
        }
    }

This app is then uploaded to SCCM and deployed as:

  • required
  • as system
  • whether or not users are logged on

When this app is executed on the device when a user is logged on and the running process is detected as being open the following happens as shown in the log file:

<![LOG[-------------------------------------------------------------------------------]LOG]!><time="11:33:50.280-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Notepad_Notepad_1_EN_01] install started.]LOG]!><time="11:33:50.332-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Notepad_Notepad_1_EN_01] script version is [1.0.0].]LOG]!><time="11:33:50.334-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Notepad_Notepad_1_EN_01] script date is [2025-09-07].]LOG]!><time="11:33:50.336-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Invoke-AppDeployToolkit.ps1] script version is [4.1.5].]LOG]!><time="11:33:50.338-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following parameters were passed to [Invoke-AppDeployToolkit.ps1]: [-DeploymentType:'install'].]LOG]!><time="11:33:50.341-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module version is [4.1.5].]LOG]!><time="11:33:50.343-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module imported in [4.9930324] seconds.]LOG]!><time="11:33:50.344-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module initialized in [3.0968536] seconds.]LOG]!><time="11:33:50.345-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module path is ['C:\Windows\ccmcache\k\PSAppDeployToolkit'].]LOG]!><time="11:33:50.346-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] config path is ['C:\Windows\ccmcache\k\Config'].]LOG]!><time="11:33:50.348-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] string path is ['C:\Windows\ccmcache\k\Strings'].]LOG]!><time="11:33:50.349-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] session mode is [Native].]LOG]!><time="11:33:50.351-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Computer Name is [VM-N1.DOMAIN.ca].]LOG]!><time="11:33:50.354-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Current User is [NT AUTHORITY\SYSTEM].]LOG]!><time="11:33:50.355-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: OS Version is [Microsoft Windows 11 Education X64 10.0.26100.6584].]LOG]!><time="11:33:50.356-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: OS Type is [WorkStation].]LOG]!><time="11:33:50.358-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Hardware Platform is [Virtual:Hyper-V].]LOG]!><time="11:33:50.359-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Current Culture is [en-US], language is [EN] and UI language is [EN].]LOG]!><time="11:33:50.360-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell Host is [ConsoleHost] with version [5.1.26100.6584].]LOG]!><time="11:33:50.361-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell Version is [5.1.26100.6584 X64].]LOG]!><time="11:33:50.363-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell Process Path is [C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell.exe].]LOG]!><time="11:33:50.364-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.42000].]LOG]!><time="11:33:50.365-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following users are logged on to the system: [DOMAIN\UserX].]LOG]!><time="11:33:50.367-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Session information for all logged on users:
 
NTAccount             : DOMAIN\UserX
SID                   : S-1-5-21-1060284298-436374069-1708537768-133359
UserName              : alt421
DomainName            : DOMAIN
SessionId             : 2
SessionName           : 31C5CE94259D4006A9E4#0
ConnectState          : WTSActive
IsCurrentSession      : False
IsConsoleSession      : False
IsActiveUserSession   : True
IsValidUserSession    : True
IsUserSession         : True
IsRdpSession          : True
IsLocalAdmin          : False
IsLocalAdminException : 
LogonTime             : 9/25/2025 11:31:21 AM
IdleTime              : 00:00:51.5088314
DisconnectTime        : 
ClientName            : WS1
ClientProtocolType    : RDP
ClientDirectory       : C:\WINDOWS\system32\mstscax.dll
ClientBuildNumber     : 26100
]LOG]!><time="11:33:50.369-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Current process is running under a system account [NT AUTHORITY\SYSTEM].]LOG]!><time="11:33:50.372-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: There is no console user logged on (user with control of physical monitor, keyboard, and mouse).]LOG]!><time="11:33:50.376-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The active logged on user who will receive UI elements is [DOMAIN\UserX].]LOG]!><time="11:33:50.377-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The current execution context has a primary UI language of [en-US].]LOG]!><time="11:33:50.378-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following locale was used to import UI messages from the strings.psd1 files: [en-US].]LOG]!><time="11:33:50.380-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Unable to find COM object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.]LOG]!><time="11:33:50.381-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Device has completed the OOBE and toolkit is not running with an active ESP in progress.]LOG]!><time="11:33:50.386-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Session 0 detected, user(s) logged on to interact if required.]LOG]!><time="11:33:50.388-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The processes ['Notepad'] were found to be running and will require closure.]LOG]!><time="11:33:50.405-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Installation is running in [Interactive] mode.]LOG]!><time="11:33:50.432-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Deployment type is [Install].]LOG]!><time="11:33:50.435-360" date="9-25-2025" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Module [PSAppDeployToolkit.Extensions] imported successfully.]LOG]!><time="11:33:50.670-360" date="9-25-2025" component="PSAppDeployToolkit.Extensions.psm1" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit.Extensions\PSAppDeployToolkit.Extensions.psm1">
<![LOG[[Pre-Install] :: Getting information for installed applications...]LOG]!><time="11:33:50.763-360" date="9-25-2025" component="Get-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Found no application based on the supplied FilterScript.]LOG]!><time="11:33:50.843-360" date="9-25-2025" component="Get-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Evaluating disk space requirements.]LOG]!><time="11:33:51.014-360" date="9-25-2025" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Retrieving free disk space for drive [C:\].]LOG]!><time="11:33:51.027-360" date="9-25-2025" component="Get-ADTFreeDiskSpace" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Free disk space for drive [C:\]: [73634 MB].]LOG]!><time="11:33:51.033-360" date="9-25-2025" component="Get-ADTFreeDiskSpace" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Successfully passed minimum disk space requirement check.]LOG]!><time="11:33:51.040-360" date="9-25-2025" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Checking for running processes: ['notepad']]LOG]!><time="11:33:51.086-360" date="9-25-2025" component="Get-ADTRunningProcesses" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: The following processes are running: ['Notepad'].]LOG]!><time="11:33:51.104-360" date="9-25-2025" component="Get-ADTRunningProcesses" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Instantiating user client/server process.]LOG]!><time="11:33:51.202-360" date="9-25-2025" component="Invoke-ADTClientServerOperation" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Prompting the user to close application(s) ['Notepad.exe']...]LOG]!><time="11:33:52.186-360" date="9-25-2025" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Server\ServerInstance.cs">
<![LOG[[Pre-Install] :: Deployment deferred by the user.]LOG]!><time="11:34:29.812-360" date="9-25-2025" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Finalization] :: Closing user client/server process.]LOG]!><time="11:34:29.842-360" date="9-25-2025" component="Close-ADTClientServerProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Finalization] :: [Notepad_Notepad_1_EN_01] install completed in [39.9763652] seconds with exit code [1602].]LOG]!><time="11:34:30.251-360" date="9-25-2025" component="Close-ADTSession" context="NT AUTHORITY\SYSTEM" type="2" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[-------------------------------------------------------------------------------]LOG]!><time="11:34:30.254-360" date="9-25-2025" component="Close-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="5812" file="C:\Windows\ccmcache\k\PSAppDeployToolkit\PSAppDeployToolkit.psm1">

Code section that checks if deployment is not interactive is bypassed and user is presented with an interactive prompt to close the running process.

On standard workstations where there is a primary user, this new behavior may not be an issue as letting users interact with the close process dialog would still accomplish the goal of updating the app, but there are some other use cases in our environment such as presentation computers, public use devices and display screens where we absolutely don't want to present any UI prompts to the active user and rely on the system retrying the installation to opportunistically perform the installation when either no users are logged on or the process is no longer open.

My guess is that our approach as to how we've been deploying our apps will need to change. Maybe tagging the devices somehow where we don't want to present any interactive UI elements and based on that tag, suppressing all of the dialogs even in an Interactive deployment.

Feel free to ping me directly if you need me to provide any additional documentation, etc.

Thank you.

This is the smoking gun I was after. Such a check was removed in 4.1.x because it doesn't make any difference whether the process is user interactive or not anymore since we can still show the UI anyway, just as long as a user is logged on.

The removal of this is also important for our Intune folk because the process is never going to be an interactive process, therefore they shouldn't be auto-switched to NonInteractive under such circumstances.

I'll need to have a think as to what we do here. I can agree that the behaviour you're wanting from this is desirable, however the entire mechanism on how it worked probably more closely puts it into the "undefined behaviour" category at best. Will come back to you probably next week.

1 Like

Hey

its me from reddit can i send something privat for you?
some logs and installation script so maybe you can help i am not sure i can send them here if there are any info in the files i dont like to share.