473,324 Members | 2,268 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,324 software developers and data experts.

Starting a process as a different user

Hello Friends,

I am using .NET 2.0 with Visual C#. I see that the Process.Start()
method permits one to launch a new process as another user by
specifying the additional username, password and domain parameters. I
have a service (which runs as SYSTEM) and would like it to launch a
process using the account for the currently logged on user (let us call
this account "User"). Unfortunately, this is not working and I receive
an "Access Denied" exception.

I've googled and found others with the same problem but haven't seen
any solutions. Has anyone been successful with this?

Thanks,

Mike

Aug 10 '06 #1
1 1631
Hello, Cyron!

C I've googled and found others with the same problem but haven't seen
Cany solutions. Has anyone been successful with this?

Process.Start with UserName specified calls native CreateProcessWithLogonW API.

This win32 api has a limitation under WinXP and Win2003, docs say

"You cannot call CreateProcessWithLogonW from a process that is
running under the LocalSystem account, because the function uses the logon
SID in the caller token, and the token for the LocalSystem account does not
contain this SID. As an alternative, use the CreateProcessAsUser
and LogonUser functions.
"
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Aug 10 '06 #2

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

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
2
by: johnmann56 | last post by:
Hello. I have written a simple image viewer application using C# .NET. It only needs to display one image at a time. When a different program, in C, running on the same machine, does a...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
3
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
3
by: Christopher | last post by:
One of our ASP.NET Pages is starting a new Process using the Process object. When the process starts, it is started under the ASPNET User. We tried editing the web.config file and the...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
6
by: ludwig.stuyck | last post by:
Hi all, I need to start an executable from within a windows service. I tried the following code in the windows service: ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName =...
1
by: mikelujan | last post by:
Hi, Our application starts an external application using System.Diagnostics.Process class and the Start() method, as per code snippet below. This application run as a Windows service, and must...
0
by: Dominic | last post by:
Every thing work fine when I am not starting process as another user. When I am starting process as another user, the authentication is working (I can see it in my workstation security log), but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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

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.