473,624 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Impersonating a User and Starting Standalone Processes stop workin

Overview:
We're creating a ASP.NET app in C# that calls some C# programs we've
created. Our DB server is on a w2k3 machine and using our w2k machines as our
web server. Without setting an Identity in the web.config we can not access
the DB on the w2k3 machine at all. So a temporary solution we had was to use
the w2k3 machine as the DB and Web server but this isn't the setup that has
be requested to duplicate.

Problem:
When we set an Identity in the web.config we can access the w2k3 DB but when
we start our offline processes they just sit there and eat up CPU usage and
don't do anything. This happens both when we us w2k and w2k3 as a Web server.
The code we use to call our offline app is:
Process publish = new Process();
publish.StartIn fo.FileName = appLocation;
publish.Start() ;

When we don't impersonate a user in the web.config and run it off the w2k3
machine the offline process run like a charm.

So I'm hoping someone will be able to help with either A) Another technique
for gaining access to the DB on the w2k3 machine or B) Get our processes not
to just sit there and eat up cpu usage and not do a damn thing.

Thanks
--
---------------------------------------
Gene
Software Developer
Nov 19 '05 #1
1 1208
when you create a process and don't specify the login, it the login of the
creating process, not thread, so thread impersonation has no effect. a
couple options:

1) change the account asp.net runs under (see machine.config) to a domain
account
2) use w2k3 and an application pools (simular to above)
3) use CreateProcessAs User api call to start the process (requires access
name and password)

-- bruce (sqlwork.com)
"Indepth" <In*****@discus sions.microsoft .com> wrote in message
news:F2******** *************** ***********@mic rosoft.com...
Overview:
We're creating a ASP.NET app in C# that calls some C# programs we've
created. Our DB server is on a w2k3 machine and using our w2k machines as
our
web server. Without setting an Identity in the web.config we can not
access
the DB on the w2k3 machine at all. So a temporary solution we had was to
use
the w2k3 machine as the DB and Web server but this isn't the setup that
has
be requested to duplicate.

Problem:
When we set an Identity in the web.config we can access the w2k3 DB but
when
we start our offline processes they just sit there and eat up CPU usage
and
don't do anything. This happens both when we us w2k and w2k3 as a Web
server.
The code we use to call our offline app is:
Process publish = new Process();
publish.StartIn fo.FileName = appLocation;
publish.Start() ;

When we don't impersonate a user in the web.config and run it off the w2k3
machine the offline process run like a charm.

So I'm hoping someone will be able to help with either A) Another
technique
for gaining access to the DB on the w2k3 machine or B) Get our processes
not
to just sit there and eat up cpu usage and not do a damn thing.

Thanks
--
---------------------------------------
Gene
Software Developer

Nov 19 '05 #2

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

Similar topics

1
1670
by: rs035 | last post by:
good morning, everybody i know, it seems more to be a problem according to unix but i got it while developing software with php: i have 2 different users on a hp-ux machine that execute php scripts. they are both in the same group. these php scripts start background processes, i can communicate with using signals (sending with posix_kill, starting background processes via pcntl_fork). so i got severel background processes owned by my 2...
7
717
by: Yosh | last post by:
I am developing an application that will stop and start a process on a remote machine. What security rights are needed for my application to be able to do this? Hope this makes sense. Yosh
4
9433
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I pass the socket to a class which just reads from the socket (in a thread). class Reader(Thread): def run(self): while 1:
0
1923
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. Chris. code :
7
2378
by: Jason | last post by:
I have an ASP.NET application with forms authentication. However, the login details correspond to a Windows account (I cannot use Windows authentication). If I obtain a token with LogonUser, can I store it in a session variable and perform an impersonation on each page load? How long is that token valid? If I do an impersonation on each page load but never an Undo, will it cause problems? I think that once the response finishes, the...
6
2422
by: CJM | last post by:
I use the following technique to impersonate a user in ASP, in order to query active directory: http://support.microsoft.com/default.aspx?scid=kb;EN-US;248187 Although the article indicates that this technique is supported by IIS4 & IIS5, I actually run it successfully on Windows Server 2003 (IIS6). However, I've got a new development machine which is running XP Pro x64 Edition, and now this technique doesnt work ('Cannot create...
7
3327
by: gel | last post by:
Below is how it is down with vbscript. What is the best way to convert this to python? strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colMonitoredProcesses = objWMIService. _ ExecNotificationQuery("select * from __instancecreationevent " _ & " within 1 where TargetInstance isa 'Win32_Process'")
4
3125
pbmods
by: pbmods | last post by:
Heya. I just installed PHP-Java-Bridge on my system, but I'm having a hard time getting it to stop crashing Apache. When I activate the 'Java.so' module in php.ini, I get the following error in my Apache logfile: Attempting to load any page on my webserver results in a segfault. Whee.
10
1821
by: John | last post by:
Hi My app does a few processes and the app can not be closes mid way. Therefore I want to be able to block any attempt of closing app by user such as by clicking on close (cross) or Alt-F4 and once the app is finished doing what it is doing to close. In other words I need to close the app gracefully. How can I achieve this? Thanks
0
8249
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6112
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.