Re: Launch Application as Different User in C# Windows Applicatoin

Tech-Archive recommends: Speed Up your PC by fixing your registry



Sorry for confusion, I might not be clear about my question.

Yes, I know how to impersonate when I create NEW process using
ProcessStartInfo class. There are many examples over the Internet.

However, I was wondering what if I impersonate a code block using
WindowsIdentity.Impersonate() and the code block contains creating new
process, does new process inherit security context from the
impersonated security context or parents security context?

Per Willy's reply, it seems that new process will still inherit it from
parents security context even though impersonation occured before the
code block.

I hope that this clears my question.

Thank you,




Samuel R. Neff wrote:
I'm confused. In your original post I thought you said you knew how
to do impersonation for a process but wanted to know how to do
impersonation for a thread. Was that not your question?

Sam


.



Relevant Pages

  • Re: Yet another permissions thing
    ... following illustrates how to duplicate a token and use it to handle COM security context issues related to ... // Run this function on a separate thread using the impersonation token of the callers thread ... >>> the folder and Directory.CreateDirectory works fine. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Security Context in Threads
    ... > and within that thread change the security context of the current ... > in which i perform the impersonation under is thread B. ... but i now need to launch another thread ... however the newly created thread will have reduced access rights to ...
    (microsoft.public.dotnet.security)
  • Re: Impersonation in ASP.net
    ... I think what you are trying to do is impersonation in order use the current ... security context to do something to a file on a remote drive. ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Permission required to execute a DTS package from ASP.NET applicatio?!!
    ... Yes,I've enabled impersonation in my application and that's why it is under ... > does SQL server is on the same server as your ASP.net application? ... >> I'm calling a DTS package from my asp.net application.Apparently because ... >> of the current security context and it is my Domian user name and I'm ...
    (microsoft.public.sqlserver.dts)
  • Re: Security context used for DBPROP_MULTIPLECONNECTIONS sessions
    ... Do you do the impersonation on the main thread or are you spinning off a new ... we would get a database logon failure. ... > the session created for us did not use the credentials of the session ... > opens the datasource under that security context. ...
    (microsoft.public.data.oledb)