Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Starting a process (.exe-file) from ASP.NET with different user credentials

Reply
Thread Tools

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

 
 
Jørn A.
Guest
Posts: n/a
 
      09-10-2004
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.


 
Reply With Quote
 
 
 
 
Lars-Erik Aabech
Guest
Posts: n/a
 
      09-10-2004
Could you set up a small subweb that impersonates the user you want?
(using <impersonate> in web.config)

Lars-Erik

"Jørn A." <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
 
Jørn A.
Guest
Posts: n/a
 
      09-10-2004
It seems like System.Diagnostics.Process.Start() still runs as the ASPNET
account.

-Jørn A.


"Lars-Erik Aabech" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Could you set up a small subweb that impersonates the user you want?
> (using <impersonate> in web.config)
>
> Lars-Erik
>
> "Jørn A." <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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.
>>
>>

>
>



 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      09-10-2004
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."
<(E-Mail Removed)> wrote:

>It seems like System.Diagnostics.Process.Start() still runs as the ASPNET
>account.
>
>-Jørn A.
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
"The credentials supplied conflict with an existing set of credentials" -=rjh=- NZ Computing 2 07-15-2006 11:09 PM
How do I get the process id when starting a process using os.popen2 or os.popen3 on linux? mikem76@gmail.com Python 1 06-07-2006 10:27 PM



Advertisments