473,395 Members | 1,386 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,395 software developers and data experts.

Starting a process (.exe-file) from ASP.NET with different user credentials

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 service. The service is running with the credentials of
a specified domain user, and all processes kicked off by the scheduler
service runs with these credentials.

In the web based interface I want to add a "Run" button for each job, making
it possible to start a job (script) manually. The button is supposed to
start a process on the webserver, and I want this process to run with the
credentials of a specific user account (the same account as the scheduler
service runs as).

I tried using...
System.Diagnostics.Process.Start(strPathToExecutab le, strArguments)
....but today processes started runs as the local ASPNET-account.

I found that there are two possible solutions.
1. This is a website that uses Integrated Windows(nt challenge/response)
authentication, and I could start the process with the credentials of the
user pushing the "Run" button (the user logged on to the website though the
web browser).
2. I could run the process with the credentials of one specific user
accound, independent of which user is clicking it.

I think the latter is preferable.

If anyone can help me with this dilemma I would really appreciate it.

-Jørn A.
Nov 18 '05 #1
3 2534
Could you set up a small subweb that impersonates the user you want?
(using <impersonate> in web.config)

Lars-Erik

"Jørn A." <no**********@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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 service. The service is running with the credentials of a specified domain user, and all processes kicked off by the scheduler
service runs with these credentials.

In the web based interface I want to add a "Run" button for each job, making it possible to start a job (script) manually. The button is supposed to
start a process on the webserver, and I want this process to run with the
credentials of a specific user account (the same account as the scheduler
service runs as).

I tried using...
System.Diagnostics.Process.Start(strPathToExecutab le, strArguments)
...but today processes started runs as the local ASPNET-account.

I found that there are two possible solutions.
1. This is a website that uses Integrated Windows(nt challenge/response)
authentication, and I could start the process with the credentials of the
user pushing the "Run" button (the user logged on to the website though the web browser).
2. I could run the process with the credentials of one specific user
accound, independent of which user is clicking it.

I think the latter is preferable.

If anyone can help me with this dilemma I would really appreciate it.

-Jørn A.

Nov 18 '05 #2
It seems like System.Diagnostics.Process.Start() still runs as the ASPNET
account.

-Jørn A.
"Lars-Erik Aabech" <la**************@markedspartner.noSPAMBLOCK> wrote in
message news:Op**************@TK2MSFTNGP09.phx.gbl...
Could you set up a small subweb that impersonates the user you want?
(using <impersonate> in web.config)

Lars-Erik

"Jørn A." <no**********@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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 service. The service is running with the credentials

of
a specified domain user, and all processes kicked off by the scheduler
service runs with these credentials.

In the web based interface I want to add a "Run" button for each job,

making
it possible to start a job (script) manually. The button is supposed to
start a process on the webserver, and I want this process to run with the
credentials of a specific user account (the same account as the scheduler
service runs as).

I tried using...
System.Diagnostics.Process.Start(strPathToExecutab le, strArguments)
...but today processes started runs as the local ASPNET-account.

I found that there are two possible solutions.
1. This is a website that uses Integrated Windows(nt challenge/response)
authentication, and I could start the process with the credentials of the
user pushing the "Run" button (the user logged on to the website though

the
web browser).
2. I could run the process with the credentials of one specific user
accound, independent of which user is clicking it.

I think the latter is preferable.

If anyone can help me with this dilemma I would really appreciate it.

-Jørn A.


Nov 18 '05 #3
Hi Jørn A.:

Yes, when a new process spawns it always takes the identity of the
host process and not the identity of the thread you launch from.

The only real way to get this to work in 1.1 is to PInvoke
CreateProcessWithLogonW. If you are trying to launch a GUI application
however, you are going to run into problems since ASPNET runs in a non
interactive desktop.

--
Scott
http://www.OdeToCode.com

On Fri, 10 Sep 2004 15:23:52 +0200, "Jørn A."
<no**********@nospam.com> wrote:
It seems like System.Diagnostics.Process.Start() still runs as the ASPNET
account.

-Jørn A.


Nov 18 '05 #4

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

Similar topics

1
by: Gus | last post by:
Hi: I know that it is possible to run an application using System.Diagnostics, for example: System.Diagnostics.Process.Start("iexplore"); This will start internet explorer in name of the...
7
by: Shawn Anderson | last post by:
Does anyone know how to get Process.Start() to use the security context of the user that my ASP.NET app is impersonating? It seems that it is always run as the ASPNET User no matter what I do. ...
0
by: Phil Appel | last post by:
I am attempting to launch an executable from an ASP.NET site using the following code: ---------- ProcessStartInfo psi = new ProcessStartInfo(sforcePath); psi.UseShellExecute = false;...
1
by: ranju | last post by:
I am trying to spawn a process (say an exe file) with different user crendentials than that of the current user. 1) Called LogonUserEx() to logon the user and recieve a handle to the token that...
2
by: =?Utf-8?B?Z292ZXI=?= | last post by:
Hello, I want to provide the ability to log on to a web application on our intranet using different credentials like they do in Sharepoint 2007. When a user hits the site, i want him...
3
by: antonyliu2002 | last post by:
I have a website (call it WinAuthWeb) that uses Integrated Windows Authentication. In my ASP.NET web application, I collect user name, password and domain info and pass them to WinAuthWeb for...
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...
2
by: IronMike | last post by:
I'm writing a program that needs to write files to a network share. My problem is that the program users are working on PCs that are not connected to our domain and the program needs to save files to...
0
by: starrysky | last post by:
I have a process (A) that runs at user login on many systems. The users are usually not Administrators. I want the process to be able to launch a process (B) to do Admin level tasks. I have a common...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.