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

Discussion in 'ASP .Net' started by Jørn A., Sep 10, 2004.

  1. Jørn A.

    Jørn A. Guest

    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(strPathToExecutable, 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.
    Jørn A., Sep 10, 2004
    #1
    1. Advertising

  2. Could you set up a small subweb that impersonates the user you want?
    (using <impersonate> in web.config)

    Lars-Erik

    "Jørn A." <> wrote in message
    news:%...
    > 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(strPathToExecutable, 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.
    >
    >
    Lars-Erik Aabech, Sep 10, 2004
    #2
    1. Advertising

  3. Jørn A.

    Jørn A. Guest

    It seems like System.Diagnostics.Process.Start() still runs as the ASPNET
    account.

    -Jørn A.


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

    >
    >
    Jørn A., Sep 10, 2004
    #3
  4. Jørn A.

    Scott Allen Guest

    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."
    <> wrote:

    >It seems like System.Diagnostics.Process.Start() still runs as the ASPNET
    >account.
    >
    >-Jørn A.
    >
    >
    Scott Allen, Sep 10, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shruti A via .NET 247
    Replies:
    0
    Views:
    734
    Shruti A via .NET 247
    May 15, 2004
  2. Adrian Bezzina
    Replies:
    0
    Views:
    398
    Adrian Bezzina
    Jan 18, 2005
  3. Replies:
    1
    Views:
    423
    Fredrik Lundh
    Jun 7, 2006
  4. Andy Klare

    File.Move() using different credentials?

    Andy Klare, Nov 30, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    753
    Andy Klare
    Nov 30, 2006
  5. ranju
    Replies:
    1
    Views:
    707
    Jack Klein
    May 18, 2007
Loading...

Share This Page