473,406 Members | 2,816 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,406 software developers and data experts.

How? Granting elevated privileges to a web service / kill a process

I need to be able to kill a process programmatically under ASP.NET. IIS
runs under the local system account. The user accessing the web is using
anonymous access.

We would prefer NOT to grant elevated security to the proxy used for
anonymous access. Is there a way to either establish a temporary
security context, programmatically for the .NET Framework Process.Kill
to operate under? Or perhaps a way to give the compiled binary produced
this privilege? We may be willing to hard code a username credential in
code in order to help limit the broad scope assignment of privileges.

The need for this comes from what I believe to be a bug in EXCEL. We use
automation in ASP.NET code. We wind everything down, call the various
closes, and release all references, but we find the web server to be
soon littered with many orphaned EXCEL processes. One for each instance
made via automation.

We have developed an approach to see the new EXCEL process being created
at the very moment we instance EXCEL, and track the PID. When we have
done absolutely everything we can to release the workbook, and close
EXCEL, and it still has not gone away, then we kill the process. This
has worked in many contexts, but falls on its face in an ASP.NET
webservice due to the fact that it has insufficient privileges.

Thanks for your help. Best regards - Lee Gillie, Spokane WA
Nov 19 '05 #1
1 3569
He Lee,

It seems to me that you'd want to create a special password-protected page
and implement impersonation for that page. The impersonation would use the
ID/password of an account that has sufficient privileges (admin?) to execute
Process.Kill.

http://msdn.microsoft.com/library/de...ersonation.asp

The account will have to have broad permissions:

"SecurityPermission for calling any members of System.Diagnostic.Process
with full trust. Associated enumeration: PermissionState.Unrestricted "

"Lee Gillie" <Le*@nospam.odp.com> wrote in message
news:42**************@nospam.odp.com...
I need to be able to kill a process programmatically under ASP.NET. IIS
runs under the local system account. The user accessing the web is using
anonymous access.

We would prefer NOT to grant elevated security to the proxy used for
anonymous access. Is there a way to either establish a temporary security
context, programmatically for the .NET Framework Process.Kill to operate
under? Or perhaps a way to give the compiled binary produced this
privilege? We may be willing to hard code a username credential in code in
order to help limit the broad scope assignment of privileges.

The need for this comes from what I believe to be a bug in EXCEL. We use
automation in ASP.NET code. We wind everything down, call the various
closes, and release all references, but we find the web server to be soon
littered with many orphaned EXCEL processes. One for each instance made
via automation.

We have developed an approach to see the new EXCEL process being created
at the very moment we instance EXCEL, and track the PID. When we have done
absolutely everything we can to release the workbook, and close EXCEL, and
it still has not gone away, then we kill the process. This has worked in
many contexts, but falls on its face in an ASP.NET webservice due to the
fact that it has insufficient privileges.

Thanks for your help. Best regards - Lee Gillie, Spokane WA

Nov 19 '05 #2

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

Similar topics

2
by: Ted | last post by:
How do I grant all privileges for a schema that has a large number of existing tables, procedures, functions, etc to a newly created role, without having to issue a grant statement for each object...
3
by: Tim Werth | last post by:
I have a Windows Service that is running as an administrator account. Some of it methods create files for a COM+ client to digest and puts them in C:\Documents and Settings\All Users\Application...
7
by: Steve Long | last post by:
In writing a Windows service with .NET, I'm noticing that the process for some services can not be killed with specifically stopping the service. If you try to kill the process with, say task...
4
by: Kris | last post by:
I have a Windows Service in C# talking to a serial port and using Remoting. It also uses several COM objects. On customer's computer the service will occassionally hang somewhere - the service...
1
by: Shalini | last post by:
Hi I am posting this again.Sorry for the trouble. I just have a third party dll which does some custom functionality. The Dll have some apis which run only when the user is an administrator. I...
3
by: zxo102 | last post by:
Hi there, I have a python application (many python scripts) and I start the application like this python myServer.py start in window. It is running in dos window. Now I would like to put it...
4
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
7
by: Peter Bradley | last post by:
Hi, I'm writing a Web service (the first one I've ever written in anger, by the way) that has to do some AD manipulation and then has to create some directories on some remote servers. Doing...
0
by: EricBlair | last post by:
Hello, I wrote a windows service that is supposed to start an interactive GUI app. I realize a service will not readily do this so I've pieced together the code below to bypass that. However, the...
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: 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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.