-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is ServiceUI.exe actually being used? #39
Comments
Hey, so this wasnt a mistake, but rather an issue i tried to solve but only half way through, so the changes regarding ServiceUI have been reverted. I am working on a solution that actually uses both. |
Hey @Joly0, so I did some testing and I strongly believe ServiceUI is not the right tool here. It works kinda the other way around than is needed for running something in System context. Talking about the psexec way of running PS1 scripts in Sandbox in System context I was initially having trouble with that since the builtin command line (referenced above) didn't seem to do anything. Running it manually from within the sandbox I was getting "The network path was not found" error and I couldn't figure out why. I noticed that each such failed run generated a windows event under Microsoft-Windows-SMBClient/Connectivity log that said:
The sandbox actual hostname is always in the GUID format that psexec seems to truncate to 15 characters (which is NETBIOS name standard) when connecting to. I'm not sure whether it's psexec limitation or something in my environment. Does it work for anyone at all? What eventually worked for me was adding \localhost and omitting -i and -d switches, like this: When you mention you're working on a solution that uses both psexec and ServiceUI, do you mean something like running a powershell script using ServiceUI from a "psexec -s" shell? I tried that to achieve an interactive window running powershell as System but didn't succeed. |
Yes, i found the same solution and for me -i still worked, not sure why it doesnt work for you. Too close this, i initially thought serviceUI allowed to run as system with interactive window, but it was only to allow system processes to be visible to the user context. That was my mistake but i still think both systems together might really help, especially when troubleshooting. |
You can take a look at my fork here https://github.com/Joly0/Run-in-Sandbox/blob/master/Sources/Run_in_Sandbox/IntuneWin_Install.ps1 |
Having visibility while running powershell scripts is a big bonus, totally agree, and therefore I was eager to make all PS1 options interactive. As soon as I wrote my last post, I found a way to combine psexec -s and ServiceUI. Goes like this:
Notes:
I have also added interactivity for other two PS1 options, I can share them separately if you want. |
Ye, my approach is quite similar and i found paexec aswell, but not sure if its safe to use. Psexec is by microsoft (or sysinternals/Mark Russinovich to be more precise) and therefore a trusted developer imo. Paexec is by PowerAdmin, which is a well-known Company. But if i had to decide between open source aspect and a more trusted publisher, i'd trust microsoft more with psexec, but thats just my point of view. |
Hi, sorry for the delay, i was a but busy with work. |
Btw, this issue is fixed in my fork and therefore in my PR |
RunInSandbox.ps1 mentions a contribution from @Joly0 "Added ServiceUI in favor of psexec", however I can still see psexec being used in the code for the PS1System profile, while ServiceUI doesn't seem to be used anywhere at all. Was it ever changed?
Run-in-Sandbox/Sources/Run_in_Sandbox/RunInSandbox.ps1
Line 343 in be67c90
As far as I can see a fork by @Joly0 actually uses ServiceUI, not psexec, so I'm really confused here. Could you clarify what was the intention? Was it a mistake?
The text was updated successfully, but these errors were encountered: