473,390 Members | 1,348 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,390 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 3568
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.