473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

CreateProcessAsUser - How to get User Token

Hello,
I have three questions, and any answer might help :)

1.
I have the following situation:
I have application that is launched from the SYSTEM User, so it runs under this
user too. That of course is a high security risk in many aspects. I know how
to Create a process "AsUser", but I have to know the Username and Password
for a user to do so. Is there a way (= does anyone know a way) to get the
User Token for the User that is logged on, so I can run the Program under
his security context and on his desktop?

2. I have two applications: one has to get that token, and the other has to use
it. There is no client-server between these two applications, so one of the
ways to do that is that they communicate via a file. I.E.: The first
application will get the token (which is an handle),
write it to a file on the hardisk, and then the other application will read
the file, retrieve the token from it and use it.
Does anyone knows if it is possible to do that, and how? (how should the
token be written to a file)?

3. I have another problem that I'll try to explain, and maybe anyone will have
an idea for that too:
There is an option for the IIS in the web-server to run images in the
security context of the user who is logged-on in the machine where the
browser is.
Now, assume that a user logged-on in machine A as "mayash", opened a browser
and browsed to a virtual directory in machine B (machine B is the web-server
with IIS). This virtual directory in machine B contains a simple ".cgi"
image that is executed by the IIS.
The IIS executes it under the context of "mayash".
I am looking for a way for this ".cgi" image to get the "token" of mayash
and use it for another things.
(i.e. - to get the token from the IIS thread that runs it....)
Does anyone has any idea how to do that?

Thank you very much for any help,
Maya.
Jul 22 '05 #1
1 6022
Maya wrote:
I have three questions, and any answer might help :)
[...off-topic questions snipped...]


You need to visit comp.os.ms-windows.programmer.win32 (probably)
and if they can't answer your MS IE-specific questions, they will
most likely give you better directions.

V
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pete Fong | last post by:
Dear all, I am a beginner with Python. I want to write a program as "runas" in Windows XP. But I have got the following error: File...
0
by: Balamurugan KR | last post by:
I am trying to impersonate and start a new process using the following steps. 1. LogonUser 2. LoadUserProfile 3. CreateEnvironment Block 4. CreateProcessAsUser. The above works fine if the ...
1
by: Maya | last post by:
Hello, I have three questions, and any answer might help :) 1. I have the following situation: I have application that is launched from the SYSTEM User, so it runs under this user too. That of...
3
by: Bo | last post by:
In my asp.net webservice application, I need to launch a DOS process as authorized users. To impersonate users, I use <impersonation = true> in my webconfig. I can't use Diagnostics.Process.Start,...
8
by: RTT | last post by:
i'm writing a windows form but codebased a iwant to run the code as a different user. like in a webapplication you can impersonate a user so the website does not run on the standard ASP.NET...
1
by: Jay | last post by:
Hey There, I am trying to execute the CreateProcessAsUser function, but when I do, I get this error: "Cannot create a file when that file already exists.". What would cause that error to occur in...
0
by: EricBlair | last post by:
Hello, I wrote a windows service that is supposed to start an interactive GUI app. I realize a service will not readily do this so I've pieced together the code below to bypass that. However, the...
0
by: =?Utf-8?B?Qm9iaWw=?= | last post by:
I run under SYSTEM account the code posted below. My goal is run an executable in a specific user context. With Windows XP works fine but with Vista the executable doesn't run. anyone can help me?...
4
by: =?Utf-8?B?WmFyYm9yZw==?= | last post by:
I'm writing a little program that will run when a user logs in, checks their password expiration and also installs a piece of monitoring software if necessary. The program has to run on Vista so I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.