Impersonating a User and Starting Standalone Processes stop workin

G

Guest

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.StartInfo.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
 
B

Bruce Barker

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 CreateProcessAsUser api call to start the process (requires access
name and password)

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top