Running a Process with <impersonate="true">

Discussion in 'ASP .Net' started by joeted, Apr 20, 2004.

  1. joeted

    joeted Guest

    Hello,

    I am trying to run a batch file on a (remote) .NET server (i'm not the
    admin) using system.diagnostics.process

    I find that the batch file is successfully executed.

    However, when i put <identity impersonate="true"/> in my web.config i
    get an "access denied" exception.

    This line in web.config is required as it was the only way (i have
    successfully found) i could also write to a text file from an aspx page.
    [ using StreamWriter from system.io ]

    I have also tried it with and without <authentication mode="windows">

    As far as I understand the impersonate=true makes the "internet guest
    account" (machine\IUSR) run the process?

    Any solution that would allow me to do both tasks (with or without
    impersonation) would be appreciated.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    joeted, Apr 20, 2004
    #1
    1. Advertising

  2. Hi, joeted,

    You can set impersonate="true" only for the location of the page that needs
    that impersonation. Or set impersonate="false" for the page that starts the
    process alternatively.

    Have a look at the documentation for the <location> element:

    http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfLocationElement.asp

    Hope this helps
    Martin
    "joeted" <> wrote in message
    news:...
    > Hello,
    >
    > I am trying to run a batch file on a (remote) .NET server (i'm not the
    > admin) using system.diagnostics.process
    >
    > I find that the batch file is successfully executed.
    >
    > However, when i put <identity impersonate="true"/> in my web.config i
    > get an "access denied" exception.
    >
    > This line in web.config is required as it was the only way (i have
    > successfully found) i could also write to a text file from an aspx page.
    > [ using StreamWriter from system.io ]
    >
    > I have also tried it with and without <authentication mode="windows">
    >
    > As far as I understand the impersonate=true makes the "internet guest
    > account" (machine\IUSR) run the process?
    >
    > Any solution that would allow me to do both tasks (with or without
    > impersonation) would be appreciated.
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Martin Dechev, Apr 20, 2004
    #2
    1. Advertising

  3. joeted

    joeted Guest

    YES!!

    This solution works fine and I can now do both tasks within
    the same application.

    Thanks a bunch, Martin.






    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    joeted, Apr 21, 2004
    #3
    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. Kathy Burke
    Replies:
    3
    Views:
    2,696
    Kathy Burke
    Dec 22, 2003
  2. Natty Gur
    Replies:
    0
    Views:
    486
    Natty Gur
    Dec 22, 2003
  3. bdb112
    Replies:
    45
    Views:
    1,420
    jazbees
    Apr 29, 2009
  4. Bill Belliveau

    DirectoryEntry Impersonate or WindowsIdentity Impersonate?

    Bill Belliveau, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    3
    Views:
    413
    Joe Kaplan \(MVP - ADSI\)
    Jan 31, 2004
  5. bob Sterrett

    check a running process, impersonate

    bob Sterrett, Mar 6, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    135
    bob Sterrett
    Mar 6, 2004
Loading...

Share This Page