r/PowerShell • u/Any-Victory-1906 • Jan 30 '26
Question Powershell script to replace serviceui.exe
Hi,
With MDT deprecated, ServiceUI.exe is no longer officially supported or easily available.
I'm specifically looking for a replacement that can:
- escape session 0,
- obtain an interactive elevated user token,
- and launch a GUI installer inside the active user session.
This is required for legacy GUI-based installers (Oracle products, etc.) that cannot run fully unattended.
PSADT is not sufficient here, since it only injects UI but does not provide real session switching + elevation.
Has anyone implemented a viable alternative (PowerShell, C#, native Win32, etc.)?
Thanks!
7
u/mtniehaus Jan 30 '26
We've done the equivalent in C#, with all the same security downsides as ServiceUI.exe.
3
u/jeremydallen Jan 30 '26 edited Jan 30 '26
$action = New-ScheduledTaskAction -Execute "C:\Path\To\Installer.exe" $principal = New-ScheduledTaskPrincipal -GroupId "Administrators" -RunLevel Highest Register-ScheduledTask -TaskName "InteractiveInstaller" -Action $action -Principal $principal Start-ScheduledTask -TaskName "InteractiveInstaller"
Would that work for you? Forgive me I am still learning.
Or https://github.com/murrayju/CreateProcessAsUser?hl=en-US
1
u/Any-Victory-1906 Feb 02 '26
I was thinking many peoples who have this need. Unlesss everyone is still using serviceui?!
3
u/BlackV Jan 30 '26
this is relevant to my interests, psadt with the latest version did away with serviceui requirements
So I'd be interested in alternatives too
3
u/LordLoss01 Jan 30 '26
Uh, newest version of PSADT does provide elevation?
I've done Start-ADTProcess without any silent paramaters, ran the exe with the silent switch in System mode and it's given a visual installation for the user in the exe itself.