DirectoryNotFound when impersonating

From: Roger Wolfson (rogerw7979@yahoo.com)
Date: 09/08/02


From: "Roger Wolfson" <rogerw7979@yahoo.com>
Date: Sat, 7 Sep 2002 18:38:38 -0700


My aspx page has a link "Delete", which deletes a directory of temp files
from a server.

I wanted to do this in a separate thread, and have used Impersonate() to set
the principal of that thread to be a user who is an admin on the fileserver
I'm deleting from.

System.Security.Principal.WindowsIdentity.GetCurrent() , in that thread,
shows that I am who I want to be.

However, all directory commands to a different machine result in a
DirectoryNotFoundException.

(This is in C#, by the way)

System.IO.Directory.Exists("\\\\myDebuggingMachine\\c$") works fine (==true)
but
System.IO.Directory.Exists("\\\\myOtherServer\\c$") becomes false as soon as
I impersonate. Even after I impersonate,
System.Security.Principal.WindowsIdentity.GetCurrent().IsAuthenticated ==
true. (using NTLM)

Am I hitting a difference between process-level and thread-levels tokens?
Whatever my problem is, it seems to be similar to what someone else asked
here:

http://www.dotnet247.com/247reference/msgs/21/109048.aspx

Thanks for any suggetsions anyone can offer.



Relevant Pages

  • Re: Under which credentials COM makes calls from another process?
    ... There are two ways our server application (server here is not ... authenticate via SSPI. ... which is used later to impersonate thread on the server ... can get some properties of these objects: client IP address and port, ...
    (microsoft.public.win2000.developer)
  • Re: Under which credentials COM makes calls from another process?
    ... There are two ways our server application (server here is not ... authenticate via SSPI. ... which is used later to impersonate thread on the server ... can get some properties of these objects: client IP address and port, ...
    (microsoft.public.platformsdk.security)
  • Re: Sql Reporting Serviced - > ASP.NET ACCESS DENIED!
    ... The account you are logging in to when on the server doesn't have the ... do you have <Impersonate> set to True? ... > Exception Details: System.UnauthorizedAccessException: Access to the path ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
    ... I doing remoting calls over a TCP channel set to "SECURE", ... means that on the server side the ... information about the client, and it cannot impersonate the client. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Preventing login as NT AUTHORITYANONYMOUS LOGON
    ... > So the identity impersonate needs to be there so we can connect to sql. ... designated ASP.NET to run under has login credentials to your sql database. ... If one is an external web server and the one that doesn't ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast