By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Running a Process with <impersonate="true">

P: n/a
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!
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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...ionElement.asp

Hope this helps
Martin
"joeted" <an*******@devdex.org> wrote in message
news:uL*************@TK2MSFTNGP11.phx.gbl...
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!

Nov 18 '05 #2

P: n/a
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!

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.