Jump to content
Sign in to follow this  
12321

RunAs User from SYSTEM account

Recommended Posts

12321

Hi,

is there a possibility to run a script from the SYSTEM account and show a window or a GUI in another account?

To give an example if I run the following script from the USERTEST account, then I see the notepad window.

RunAs(USERTEST, @ComputerName, USERPWTEST, 0, "notepad.exe", "", @SW_SHOWMAXIMIZED)

But if I run it from the SYSTEM account, and I am logged in as USERTEST then I don't see the notepad window. I only see a process notepad.exe run as USERTEST but no visible window.

(This is obviously only a very simple example for my problem, for my script I want to start the script really as the SYSTEM account but have something visible for the logged in user.)

Share this post


Link to post
Share on other sites
JLogan3o13

If I need to run as System, I often do a fileinstall of PSEXEC, and throw it in the temp directory on the machine. PSEXEC has an option to run as system but interact with the desktop of the currently logged in user.

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
12321

First time I work with the SYSTEM account... So RunAs under the SYSTEM account is not able to interact with the desktop of the currently logged in user? Under no circumstances?

Thanks, for suggesting PSEXEC. I somehow thought that I would be able to have everything in one exe (Well but fileinstall is a nice workaround then). But seems that I have to use PSEXEC.

Edited by 12321

Share this post


Link to post
Share on other sites
JLogan3o13

If I remember correctly, psexec creates a hidden service, which is the only way to get something to run as SYSTEM. You cannot just do a RunAs. If I am incorrect, I am sure someone will wander by and tell me so :)

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
12321

Thanks for your reply :)

Will try it with PSEXEC and fileinstall now.

Share this post


Link to post
Share on other sites
12321

When I use following code and run it under the system account:

Run("PsExec.exe -s -accepteula -u USERTEST -p USERPWTEST -i notepad.exe")

Then it is still very 'user friendly', because following message pops up:

Capture.thumb.PNG.463b42f03e87948e03e3a9

 

I know it's a security measure... But is there any way around it?

Edited by 12321

Share this post


Link to post
Share on other sites
JLogan3o13

What do you get when you click the Why does this happen link?

(Hint: Yes there is something you can do, and that link - along with Google - will show you) :)


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×