DirectoryNotFound when impersonating
From: Roger Wolfson (rogerw7979@yahoo.com)
Date: 09/08/02
- Next message: Joe Johnston: "Re: Encryption and Decryption using MemoryStream"
- Previous message: Spelcher: "Credit Cards and cryptography"
- Next in thread: Willy Denoyette [MVP]: "Re: DirectoryNotFound when impersonating"
- Reply: Willy Denoyette [MVP]: "Re: DirectoryNotFound when impersonating"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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.
- Next message: Joe Johnston: "Re: Encryption and Decryption using MemoryStream"
- Previous message: Spelcher: "Credit Cards and cryptography"
- Next in thread: Willy Denoyette [MVP]: "Re: DirectoryNotFound when impersonating"
- Reply: Willy Denoyette [MVP]: "Re: DirectoryNotFound when impersonating"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|