• Welcome to Support Forum: Get Support for Patch My PC Products and Services.
 

Intune App won't install if using ServiceUI.exe and a user is not logged in

Started by swoonhusker, October 01, 2024, 08:20:24 AM

Previous topic - Next topic

swoonhusker

We have been using PSADT to install Kofax Power PDF Advanced with an Intune Win32 app and it allows us to prompt the user to close applications. We have to use ServiceUI.exe so that the user can see the prompt.

The issue is that if a user is not logged into the computer, then the application will not update.

I found this article as a possible solution but it is 5 years old- https://svdbusse.github.io/SemiAnnualChat/2019/09/14/User-Interactive-Win32-Intune-App-Deployment-with-PSAppDeployToolkit.html

I am wondering if I should go this route (which runs a PowerShell script to see if the user is logged in or not and then tells PSADT to run in non-interactive mode if a user is not logged in) or if PMPC or others have a better suggestion that we should be using instead?

In the past I've asked about utilizing the PMPC notification window for installs and was told to use PSADT instead. The install also has lots of files so I don't think PMPC custom apps is an option either.

Melissa (Patch My PC)

Hi,

Thanks for reaching out to us! If you are using the Publisher, you should be able to use your PSADT for Kofax Power PDF Advanced and create a Custom Application. PSADT will include multiple files, so you will have to use the Publisher to add them after creating the Custom Application. If you are Cloud Only and not using the Publisher, there currently isn't an option to add additional files to a Custom App. You can then use our Manage Conflicting Processes option to handle prompting to close the application. In case you want to go with this option, here is the steps to setup a Custom App leveraging PSADT:


Let us know if that works for you & if you have any additional questions!  :)

swoonhusker

Thank you for the reply. I think we are cloud only for custom apps but I know we do have the publisher. How can I tell if I can make this work? I do see the option to add additional files but I don't see the option to add additional folders.

Melissa (Patch My PC)

Hi! In the steps I detailed above 1-3 would be completed in the Cloud portal and the remaining steps would be done on the Publisher side. The cloud portal does not have the option to add files/folders at this time, so that would have to be done in the Publisher once the Custom App has been created in the Cloud Portal.

It might be that your Publisher hasn't been connected to the Cloud Portal? If not, you won't see the custom apps you have created show up on the Publisher side. We have an article with the steps on how to connect: https://docs.patchmypc.com/patch-my-pc-cloud/custom-apps/integrate-publisher

If you do have access to the Publisher, and a PSADT that already works, I do think it might be worth looking into using our custom apps feature. Feel free to reach out directly to us and create a support ticket, and we can go over in more detail or get a call setup to review. https://patchmypc.com/technical-support

Looking forward to hearing from you!

swoonhusker

Sorry I didn't realize at first that adding the additional files is done in the publisher. I never finished creating in the cloud apps because I didn't see that option. I missed that part and I get it now. Thank you!!

salmawis

I would like to rate this article as very good and comprehensive. The author has presented clearly, providing insight into the topic.

Dan Gough (Patch My PC)

PMPC custom apps can be an alternative to using PSADT + ServiceUI to prompt the user to close running apps. You would not need to combine both, but you could of course upload a PSADT script purely for its installation logic - I would not try to mix and match UI elements from both.

Also, if just using PSADT + ServiceUI, PSADT now has an example launcher script that solves the original problem you describe (where running serviceui.exe with no users logged on results in an error):

https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/tree/main/Examples/ServiceUI

swoonhusker

Thank you Dan that looks really good and I think I might try out that Invoke-ServiceUI.ps1 script.

The problem I ran into with using the PMPC custom app is that I have a couple lines that re-launch Teams and Outlook as the user but they don't work now that the app is a PMPC custom app-
Execute-ProcessAsUser -Path "$PSHOME\powershell.exe" -Parameters "-Command `"start outlook.exe`"" -Wait
Execute-ProcessAsUser -Path "$PSHOME\powershell.exe" -Parameters "-Command `"start ms-teams.exe`"" -Wait

If you know why those might have not worked, please let me know.

I was first checking to see if the process was running before I closed them-
$TeamsProcess = Get-Process -Name ms-teams -ErrorAction SilentlyContinue
$OutlookProcess = Get-Process -Name OUTLOOK -ErrorAction SilentlyContinue

Then if those variables were not empty, it would execute the process as the user to launch them.

Dan Gough (Patch My PC)

I'm not sure what would be different as a result of using a custom app, but I don't see a need to execute PowerShell here as the user when you could just start the Outlook/Teams exe directly? Also there should be no need to add a -Wait there.

swoonhusker

I wanted to re-launch Outlook and teams after the install because I am closing them. I don't think launching them as the system account works but I could test again. The script did work to re-launch as the user before I moved it to a PMPC custom app though.

Dan Gough (Patch My PC)

No, you would not want to launch the processes directly as System, I was suggesting you call the Outlook/Teams exe directly with Execute-ProcessAsUser. But I can appreciate your method allows you to not have to supply the full path to the exe.

PSADT's Execute-Process supports -UseShellExecute $true, which will allow you to run outlook/ms-teams with just the name - but unfortunately Execute-ProcessAsUser does not support this setting!