Re: Launch an executable as a user from an administrative account
- From: Stefan Kuhr <kustt110@xxxxxx>
- Date: Thu, 15 May 2008 13:15:10 +0200
Hello Philou66,
Philou66 wrote:
Hi,
I am logged in as an Administrator on a windows xp's Telnet server.
An user is currently logged on the machine, and from the telnet
server, I would like to run a program as if the user launched it.
A kind of runas, but I don't know the user's password.
I tried this piece of code that looks exactly to what I'm looking
for : http://sayala.com/code/ProcessAsUser.cs
If I run it simply as the logged on user, it works okay.
But if I connect to telnet, login as admin, and try it again, it will
fail on the API call OpenProcessToken.
Is there really a way to do what I'm looking for ?
The ultimate goal is to be able to modify some user parameters with
SystemParametersInfo, while being logged on as Admin.
This is possible by editing the users' registry keys, but needs
reboot!! I am looking for a way to immediatly commit any changes.
Thanks for you help, and have a nice day!
What you want to do is not really easy. You need to "steal" the token from one of the executables that the interactively logged in user is running and then launch an executable using CreateProcessAsUser with the stolen token, so it runs on the interactive user's desktop and in the context of the user. One of the problems you will face is clearly identifying a process of the user (as there are potentially many interactively logged on users), from which you can steal the token. I encourage you to look at the superusr sample that shipped with the Platform SDK samples up to and including the Windows Server 2003 SP1 Platform SDK.
--
Stefan
.
- Follow-Ups:
- Re: Launch an executable as a user from an administrative account
- From: Remy Lebeau
- Re: Launch an executable as a user from an administrative account
- References:
- Prev by Date: Re: How to mount a volume as a current user.
- Next by Date: RE: FIFO lost on Critical Section
- Previous by thread: Launch an executable as a user from an administrative account
- Next by thread: Re: Launch an executable as a user from an administrative account
- Index(es):
Relevant Pages
|