psappdeploytoolkit window popups not working when deploying with sccm as require

Im trying to learn PSADT but so far I am getting strange results when trying to deploy with sccm.

I made a skype install package that and tested it running manually, it works.
I made a deployment type in sccm with command to install: Deploy-Application.exe -DeploymentType “Install”
User experience is, install for system, whether or not a user is logged on, normal visibility
Allow uers to view and interact with program installation is grayed out and unchecked.

My goal here is to install skype silently when noone is logged on and if there is someone logged on, PSADT should ask if they can close skype.

Now I have 2 deployment for this.
1st is “available” and it works, all the windows show up, etc.
2nd is “required” so it can update all previous skype versions to this packaged one. This one installs as well, but it doesnt show any PSADT windows and force closes skype without asking.

all the settings for deployments are the same, except for the avaialble/required
user notifications are to display in software center and show only notifications for computer restarts

Question is, how do I deploy as required and have all the windows show up and wait for user to close skype ?

Make sure you tick the box on your program to ‘Allow users to interact with this program’

and

Commanline:

powershell.exe -ExecutionPolicy bypass -NonInteractive -noprofile -File .\Deploy-Application.ps1 -DeploymentType Install -Verbose

The thing is, I cannot check the box when its set to “install for system, whether or not a user is logged on” and if I choose “install for user” then it will wait for anyone to be logged in and wont start installation w/o a logged in user (when it is not needed to wait for some applications to be closed before they are updated and it could install w/o problems).

the only reason it will force close an app is if you code it in your script or you use -DeployMode ‘Silent’ in your commandline

EDIT:

Or in your deploy scipt you use:

Show-InstallationWelcome -CloseApps -Silent

Your program needs to be ran ‘When user logged in’ & With administrative rights & Allow interaction

command I used is: Deploy-Application.exe -DeploymentType “Install”
inside deploy script I have: Show-InstallationWelcome -CloseApps ‘skype’ -AllowDeferCloseApps -DeferTimes 3 -BlockExecution

From the logs below, from the “required” installation, it seems that it starts as system and ignores currently logged on user

My goal here is to install skype silently when no one is logged on and if there is someone logged on, PSADT should ask if they can close skype. Is that possible?

[Initialization] :: ******************************************************************************* PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: ******************************************************************************* PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: [Microsoft_Skype_7.32_EN_01] setup started. PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Script [C:\Windows\ccmcache\jm\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\jm\Deploy-Application.ps1] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Script [C:\Windows\ccmcache\jm\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\jm\AppDeployToolkit\AppDeployToolkitMain.ps1] PSAppDeployToolkitExt 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: [Microsoft_Skype_7.32_EN_01] script version is [1.0.5] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: [Deploy Application] script version is [3.6.5] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: The following non-default parameters were passed to [Deploy Application]: [-DeploymentType “Install”] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: [App Deploy Toolkit Main] script version is [3.6.9] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: [App Deploy Toolkit Extensions] version is [1.5.0] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Computer Name is [WARLT-020.domain.lan] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Current User is [NT AUTHORITY\SYSTEM] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: OS Version is [Microsoft Windows 7 Enterprise Service Pack 1 64-bit 6.1.7601.23572] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: OS Type is [Workstation] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Current Culture is [pl-PL] and UI language is [PL] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Hardware Platform is [Physical] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: PowerShell Host is [ConsoleHost] with version [4.0] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: PowerShell Version is [4.0 x64] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.42000] PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: ******************************************************************************* PSAppDeployToolkit 2017-02-27 15:34:14 6944 (0x1B20)
[Initialization] :: Display session information for all logged on users:

NTAccount : domain\user1
SID : S-1-5-21-2951371019-2546467088-5856931-10444
UserName : user1
DomainName : domain
SessionId : 1
SessionName : Console
ConnectState : Active
IsCurrentSession : False
IsConsoleSession : True
IsActiveUserSession : True
IsUserSession : True
IsRdpSession : False
IsLocalAdmin : False
LogonTime : 2017-02-09 12:18:04
IdleTime : 00:00:00
DisconnectTime :
ClientName :
ClientProtocolType :
ClientDirectory :
ClientBuildNumber : 0

PSAppDeployToolkit	2017-02-27 15:34:15	6944 (0x1B20)

[Initialization] :: The following users are logged on to the system: [domain\user1]. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: Current process is running under a system account [NT AUTHORITY\SYSTEM]. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: The following user is the console user [domain\user1] (user with control of physical monitor, keyboard, and mouse). PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: The active logged on user is [domain\user1]. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: The active logged on user [domain\user1] has a primary UI language of [EN]. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: The following UI messages were imported from the config XML file: [UI_Messages_EN]. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: The active logged on user [domain\user1] has a DPI scale factor of [100] with DPI pixels [96]. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence. PSAppDeployToolkit 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: Service [EventSystem] exists. Test-ServiceExists 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: Get the service [EventSystem] startup mode. Get-ServiceStartMode 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: Service [EventSystem] startup mode is set to [Automatic]. Get-ServiceStartMode 2017-02-27 15:34:15 6944 (0x1B20)
[Initialization] :: Get the service object for service [EventSystem]. Start-ServiceAndDependencies 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [EventSystem] with display name [COM+ Event System] has a status of [Running]. Start-ServiceAndDependencies 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [RpcSs] exists. Test-ServiceExists 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Get the service [RpcSs] startup mode. Get-ServiceStartMode 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [RpcSs] startup mode is set to [Automatic]. Get-ServiceStartMode 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Get the service object for service [RpcSs]. Start-ServiceAndDependencies 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [RpcSs] with display name [Remote Procedure Call (RPC)] has a status of [Running]. Start-ServiceAndDependencies 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [EventLog] exists. Test-ServiceExists 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Get the service [EventLog] startup mode. Get-ServiceStartMode 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [EventLog] startup mode is set to [Automatic]. Get-ServiceStartMode 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Get the service object for service [EventLog]. Start-ServiceAndDependencies 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [EventLog] with display name [Windows Event Log] has a status of [Running]. Start-ServiceAndDependencies 2017-02-27 15:34:16 6944 (0x1B20)
[Initialization] :: Service [Schedule] exists. Test-ServiceExists 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Get the service [Schedule] startup mode. Get-ServiceStartMode 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Service [Schedule] startup mode is set to [Automatic]. Get-ServiceStartMode 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Get the service object for service [Schedule]. Start-ServiceAndDependencies 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Service [Schedule] with display name [Task Scheduler] has a status of [Running]. Start-ServiceAndDependencies 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: The task scheduler service is in a healthy state: True. PSAppDeployToolkit 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Session 0 detected, process not running in user interactive mode; deployment mode set to [NonInteractive]. PSAppDeployToolkit 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Installation is running in [NonInteractive] mode. PSAppDeployToolkit 2017-02-27 15:34:17 6944 (0x1B20)
[Initialization] :: Deployment type is [Installation]. PSAppDeployToolkit 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Get deferral history… Get-DeferHistory 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\Microsoft_Skype_7.32_EN_01]. Convert-RegistryPath 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\Microsoft_Skype_7.32_EN_01] does not exist. Return $null. Get-RegistryKey 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: User has [2] deferrals remaining. Show-InstallationWelcome 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Check for running application(s) [skype]… Get-RunningProcesses 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: The following processes are running: [Skype]. Get-RunningProcesses 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Resolve process descriptions… Get-RunningProcesses 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Finished checking running application(s). Get-RunningProcesses 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: Force close application(s) [Skype] without prompting user. Show-InstallationWelcome 2017-02-27 15:34:17 6944 (0x1B20)
[Pre-Installation] :: [-BlockExecution] parameter specified. Show-InstallationWelcome 2017-02-27 15:34:19 6944 (0x1B20)
[Pre-Installation] :: Bypassing Function [Block-AppExecution] [Mode: NonInteractive]. Block-AppExecution 2017-02-27 15:34:19 6944 (0x1B20)

you are in Non-interactive mode

use the commandline

powershell.exe -ExecutionPolicy bypass -NonInteractive -noprofile -File .\Deploy-Application.ps1 -DeploymentType Install -Verbose

and download the latest PSADT (3.6.9)

also - it looks like you are ConfigMgr 2007

I have not tested on this version . We are currently ConfigMgr Current Branch 1606 in production…

not sure if this matters…

the PSADT example for Adobe useing CongMgr 2007 by the looks of it…

You’re running into the Session 0 problem that a lot of folks have issues with. Even though there’s a logged on user to the system, the script is still running using the NT\SYSTEM account. This account displays prompts and UI in Session 0, also known as the secure desktop. Here’s the workaround I use to break out of Session 0 and display UI and prompts to the currently logged on user.

In SCCM, I have the following set:

Install: Install.bat

Uninstall: Uninstall.bat

Install for System
Whether or not a user is logged on
Normal

Here are the command lines for each bat file:
Install: PSExec.exe -si -accepteula %~dp0ServiceUI.exe %~dp0Deploy-Application.exe
Uninstall: PSExec.exe -si -accepteula %~dp0ServiceUI.exe %~dp0Deploy-Application.exe Uninstall

I also have copies of both PSExec.exe and ServiceUI.exe (x86 version) at the root of the toolkit.

So far I’ve had success on both 64-bit and 32-bit machines. For some reason, running PSExec as SYSTEM, then running ServiceUI after, avoids the usual “Error Code 5” on 32-bit machines. The implementation may be a bit cumbersome, but it DOES WORK. If anyone else is interested, feel free to do the same.