Deployment for both User Logged on and System

I’m working on a script to deploy java 8 update 40 via appdeploytoolkit and SCCM 2012.

I’ve gotten it to work with the SCCM application set to Install for System, Only when a user is logged on and Allow users to view and interact with the program installation.

However, I would like to use the same application from a task sequence for installing the OS and it doesn’t seem to work if the Login requirement is changed to Whether or Not a Users is logged on.

Any ideas on how to handle if users are or are not logged on?

I am also looking for this functionality

Right now the options are:

  • Duplicate the Application and have a deployment type with Whether or Not a User is logged on only for use in Task Sequence (Double administrative effort).

  • Create the software as a package and lose all the functionality that Application provides.

Please be sure to make posts in the appropriate forum. This is the “Deployment Scripts” forum and is strictly for sharing your completed scripts with the community as explained in the forum description: “Repository for example and user contributed deployment scripts.” Requests for help should go into the “General” forum thread.

Unfortunately when deploying to uses in the fashion you have described you will have to either change it to per system and select whether or not a user is logged in or create one specifically for the task sequence. The big item tripping you up could be … Allow users to view and interact with the program installation. I know that when used in tasks you cannot have that item enabled.

I think that I’ve found a working method to allow an SCCM 2012 application to be used in both task sequences and with users.

Create an application with two deployment types (one for x64 and one for x86). set the user experience to both to:

Install for system; Whether or not a User is logged on.

Create a batch file to be called for each deployment type (x64 and x86), put this command into the file:

%SYSTEMROOT%\System32\qprocess.exe * | find /i “explorer.exe” >nul 2>&1 && (%~dp0ServiceUIx64.exe %~dp0Deploy-Application.exe Install) || (%~dp0Deploy-Application.exe Install)

(for x86 use ServiceUIx86,exe)

What this command does is find if the process “explorer.exe” is running and thus there is a logged on user, if so use ServiceUI.exe to launch Deploy-Application.exe to show the dialogs to the user, if no user logged on (such as in the Task Sequence) just run the Deploy-Application.exe

You can change the Install command to Uninstall to create the Uninstall batch files.

Can someone please post how they got mesasage boxes from ps app deploy to go through an SCCM deployment? I can get it when i run the local script but if i deploy through sccm i do not recieve the popup app deploy notifications.

I used a similar method to Paul, except I used a custom Global Condition -Boolean value for if a user is logged on or not. This runs a simple PS script:
$user=Query user

Be sure to Install for system, only when a user is logged in and make sure the box is checked for Allow users to interact.

While I’m sure this method would work in some scenarios, it’s of little help if you want to use the same application for OSD and normal app deployment. These settings prevents the DT to work in OSD scenario (you will not be able to add it to a TS).

In some version(s) back of the script I could have sworn that it wasn’t a problem anymore and I have deployed applications with install command Deploy-Application.exe or Powershell.exe -File .\Deploy-Application.ps1 both in OSD and up-and-running machines.

Is anyone able to give full steps on the method that Brent used (custom Global Condition -Boolean value)

Also are you able to use the powershell deployment toolkit when PC is logged out with interactive setup so the user can see that an installation is in progress.

I ask this because at the moment we are using a hta which gets deployed with the application when the pc is logged out a the hta screen displays over the alt ctrl del to logon screen. saying that a software installation is in progress then when its done the hta window disappears.


I’m using app deployment toolkit for application deployment and Task Sequence.

For that you have to download a .exe called ServiceUI.exe and put it on the same level of Deploy-Application.exe

Application Properties in SCCM:

Installation Program: ServiceUi.exe Deploy-Application.exe
You have to check “Run installation and uninstall program as 32-bit process on 64-bit clients.”

User Experience:
Install for System -> Whether or not a user is logged on -> Normal


for logged in have a group in your TS with the option select * from win32_computersystem where username IS NOT NULL

and for logged out have a group select * from win32_computersystem where username IS NULL

then use ServiceUI if the user is logged in. If not then just run a version of the script without the prompts and such.

* Duplicate the Application and have a deployment type with Whether or Not a User is logged on only for use in Task Sequence (Double administrative effort).

Does this mean if I have one deployment type for whether or not user is logged on, and one for system only (user not logged on), that I can deploy the application to all computers, and it will run the respective deployment type depending on whether a user is logged in or not?

And, I take it, in the “user not logged on” one, I would need to change the code to install and reboot silently…?

for SCCM application deployment so the toolkit runs for both the logged in user and the system.
Add the ServiceUIx86 or x64 to the root of your package where the deploy-application sits

you need to set the following user experience:
install behaviour - install for system
Logon requirement - whether or not a user is logged on
Installation program visibility - Hidden

under the program tab:
Browse to your package and select the ServiceUI x86 or x64 and select open it should read as follows
installation program - “ServiceUIx86.exe” Deploy-Application.exe

tick the run as 32 bit process on 64 bit clients if you are using the x86 ServiceUI

Deploy your application and it should work.

I’ve read a few issues around this with ServiceUI and the ones i have read had the installation as “ServiceUIx86.exe Deploy-Application.exe” this didn’t work for me until I changed it to “ServiceUIx86.exe” Deploy-Application.exe

Hope this helps

1 Like