something like this. But this is allways unmanged code. I haven't found
another solution right now.
Hope you will find another solution.
> Thanks Bjoern, but I have already impersonated my ASP.NET application and
it
> can access Network Resources. The problem, that I am facing is with the
> child process of this ASP.NET application. I spawn a new process from my
web
> service and this new process cannot inherit the security context of its
> parent thread and therefore runs under the default identity of ASP.NET
> application i.e Network Service account.
>
> The code that I supplied, is used for the creation of a new process.
>
> Thanks
> Aadil
>
> "Bjoern Wolfgardt" <vorname.nachname@spam-stop-ewetel.de> wrote in message
> news:%23shgXAgVDHA.384@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I think this is what you are looking for :
> >
http://support.microsoft.com/default.aspx?scid=kb;en-us;306158 > >
> >
> > cu
> > Bjoern Wolfgardt
> >
> >
> > "Aadil Abbas" <maa49@cornell.edu> schrieb im Newsbeitrag
> > news:Oqii37fVDHA.2004@TK2MSFTNGP10.phx.gbl...
> > > I am running a web service on IIS 6.0, impersonation is set to true,
so
> my
> > > web service can access resources depending on the client's privileges,
> but
> > > when I launch a child process from the web service, this child process
> > does
> > > not inherit the security context of its parent (impersonated) thread.
> How
> > > can I delegate this impersonation to the child process without making
> any
> > > calls to unmanaged code like CreateProcess etc.
> > >
> > > Here is my C# code, that is run from a web service, creates a child
> > process
> > > (a command shell) and tries to access a network resource. This child
> > process
> > > runs as
> > > "NT Authority\Network Service" and therefore cannot access network
> > > resources. I want to impersonate this child process, so it can access
> > > network resources depending on the rights of client.
> > >
> > > Process proc = new Process();
> > > proc.StartInfo.FileName = "cmd";
> > > proc.StartInfo.Arguments = "/k "+str+ " > h:\\temp\\log.txt";
> > > proc.StartInfo.WorkingDirectory = @"h:\temp";
> > > proc.StartInfo.UseShellExecute = false;
> > > proc.StartInfo.CreateNoWindow = true;
> > > proc.Start();
> > >
> > > Thanks
> > > Aadil
> > >
> > >
> >
> >
>
>