Session 0 not detected but still runs in silent mode (not using SCCM)

I am using PSAppDeployToolkit version 3.9.3 and am running the same Deploy-Application.exe without any additional arguments on Windows 11 Virtual Machines as users that have admin level permissions. The users are logged into the GUI. In both cases, the PSADT log says that session 0 is not detected and as mentioned, I am running just the Deploy-Application.exe which by default installs in interactive mode.

Can somebody help me understand why on one VM the installer runs in silent mode but on another VM, the same installer does not?

From the log on the VM where the PSADT installer runs in silent mode:
Session 0 not detected.]LOG]!>
Installation is running in [Silent] mode.
Deployment type is [Installation]

From the log on the VM where the PSADT installer runs in interactive mode:
Session 0 not detected.]LOG]!>
Installation is running in [Interactive] mode.
Deployment type is [Installation].]LOG]!>

I always thought session 0 meant SYSTEM account.

The EXE (Deploy-Application.exe) is to hide the PowerShell console but still show any PSADT GUIs.

The only thing that should affect Interactive or not should be if it detects a user or not.

You might find an explanation for why it was set to [Silent] earlier in the log file. Search for “deployment mode set to [Silent]”.

1 Like

Another couple of thoughts to add to the mix…

What are you using to deploy this (SCCM / Intune / Other?)?
Are you deploying this in the user context or SYSTEM context?
What is your full Install command line?

If you are deploying as SYSTEM, it would probably detect Session 0, if you are deploying as the user it won’t.
If you deploy as SYSTEM and want the user to interact with PSADT (or the applications dialogs), then I’d highly recommend using the ServiceUI.exe (part of Microsoft Deployment Toolkit)
Then your install command could be something like:
ServiceUI.exe -Process:explorer.exe Deploy-Application.exe -DeploymentType "Install"

1 Like

Thank you for the response. Yes, I agree that Session 0 refers to the isolated session where system services and background processes run.

As mentioned, I am just calling the Deploy-Application.exe because I would like the PSDADT GUI to display. Here is the section of the installer log which shows information detected about my user.

1 Like

Thank you for your additional thoughts and questions. At present, the users are running the PSADT themselves by just executing Deploy-Application.exe as administrator.
As you suggested, I can make a self-extracting executable and use ServiceUI.exe to force it to run interactively.
However, I was really trying to understand why PSADT clearly detects the active logged on non-system user but still sometimes switches it to silent mode.

I downloaded ServiceUI and tested the installation from the command prompt as shown below:

“C:\Install\ServiceUI.exe” -Process:explorer.exe “C:\Install\Test_Installer_03192024\Deploy-Application.exe” ‘Install’ -DeployMode ‘Interactive’

=======================
Matched Processes

Process Found: [explorer.exe] ID [6488] SESSION [1]

=======================
Logon Lookup

[winlogon.exe] Session: [1] PID [740] [Target Session [1] = Match]
API [OpenProcessToken] Error: [5]
API [DuplicateTokenEx] Error: [6]
API [SetTokenInformation] Error: [6]
API [AdjustTokenPrivileges] Error: [6]

=======================
Launch Process

Program to launch : [C:\Install\Test_Installer_03192024\Deploy-Application.exe]
Command line : [C:\Install\Test_Installer_03192024\Deploy-Application.exe ‘Install’ -DeployMode ‘Interactive’]

Process launching with PID [10592]
Process exit code [0]

=======================
Exiting with [0]

But it still does not display the PSAppDeployToolkit gui.
From the log:

]LOG]!><time=“15:04:47.959-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: The following users are logged on to the system: [WIN11\admin].]LOG]!><time=“15:04:47.962-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Current process is running with user account [Win11\admin] under logged in user session for [WIN11\admin].]LOG]!><time=“15:04:47.965-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Systray] does not exist. Return $null.]LOG]!><time=“15:04:48.036-420” date=“03-25-2024” component=“Get-RegistryKey” context=“Win11\admin” type=“2” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: The following user is the console user [WIN11\admin] (user with control of physical monitor, keyboard, and mouse).]LOG]!><time=“15:04:48.095-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: The active logged on user is [WIN11\admin].]LOG]!><time=“15:04:48.098-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: The active logged on user [WIN11\admin] has a primary UI language of [EN].]LOG]!><time=“15:04:48.100-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: The following UI messages were imported from the config XML file: [UI_Messages_EN].]LOG]!><time=“15:04:48.102-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: The active logged on user [WIN11\admin] has a DPI scale factor of [150] with DPI pixels [144].]LOG]!><time=“15:04:48.103-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.]LOG]!><time=“15:04:48.103-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Skipping attempt to check for and make the task scheduler services healthy, because the App Deployment Toolkit is not running under the [NT AUTHORITY\SYSTEM] account.]LOG]!><time=“15:04:48.113-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Session 0 not detected.]LOG]!><time=“15:04:48.114-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Installation is running in [Silent] mode.]LOG]!><time=“15:04:48.117-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Initialization] :: Deployment type is [Installation].]LOG]!><time=“15:04:48.120-420” date=“03-25-2024” component=“PSAppDeployToolkit” context=“Win11\admin” type=“1” thread=“5764” file=“AppDeployToolkitMain.ps1”>
<![LOG[[Pre-Installation] :: Bypassing Show-InstallationProgress [Mode: Silent].

I’ve noticed that you’ve never mentioned how you are triggering the Deploy-Application.exe , the Deploy-Application.ps1 or serviceUI.exe.

If you are not using SCCM, Intune or GPOs, how are you launching it? Third-party solution? Admin account? Scheduled task?

1 Like

Thank you for your inquiry and assistance.
At present, we have a self-extracting exe that just calls Deploy-Application.exe. Users run this exe as admin.

While testing with ServiceUI.exe, I ran the below command from the Command Prompt as admin:

“C:\Install\ServiceUI.exe” -Process:explorer.exe “C:\Install\Test_Installer_03192024\Deploy-Application.exe” ‘Install’ -DeployMode ‘Interactive’

This is why session 0 is not detected.
You are not launching the installation as SYSTEM.

It’s ok if you don’t but just don’t use ServiceUI.EXE in your situation.

1 Like

To clarify:

  • I really want and need the PSADT GUI to display to the users.
  • The users are running the Deploy-Application.exe themselves with no arguments, thus the default is to install interactively.
  • We are not using SCCM, InTune, or any other utility to launch it.
  • In some instances, the GUI displays but in many cases it does not.
  • I reviewed the PSADT logs and it says session 0 not detected… Installation running in silent mode.
  • I tried using SystemUI.exe to try to force it to display the PSADT GUI using the below command but it still does not display the PSADT GUI. The install still runs in silent mode.
    “C:\Install\ServiceUI.exe” -Process:explorer.exe “C:\Install\Test_Installer_03192024\Deploy-Application.exe” ‘Install’ -DeployMode ‘Interactive’