472,129 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,129 software developers and data experts.

Retaining local file system access while impersonating to access a remote drive

Is it possible to retain local file system read, write, delete access while
impersonating for access to a remote drive in a different domain? I need to
be able to move files from a local computer to a remote computer. do i have
to copy them from the local computer to the remote computer then delete them
fromt the local computer after undo-ing the impersonation? Or is there a way
to retain access to both the local computer and the remote computer by while
impersonating the use that has access to the remote computer? The File.Move
requires read and write access to both the filesystem of the source and the
destination because it deletes the file from the source when it is copied to
the destination. My current solution is to impersonate, copy local to
target, undo impersonation, delete locals. But i would like to be able to
impesonate, move local to target, undo impersonation.

Nov 16 '05 #1
3 2618
Daniel,

If you don't have full rights for a move in this manner, then you will
have to switch impersonation contexts. You can not have the rights merged
from two different users, as the current thread only runs in one user
context.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <so*******************@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Is it possible to retain local file system read, write, delete access
while
impersonating for access to a remote drive in a different domain? I need
to
be able to move files from a local computer to a remote computer. do i
have
to copy them from the local computer to the remote computer then delete
them
fromt the local computer after undo-ing the impersonation? Or is there a
way
to retain access to both the local computer and the remote computer by
while
impersonating the use that has access to the remote computer? The
File.Move
requires read and write access to both the filesystem of the source and
the
destination because it deletes the file from the source when it is copied
to
the destination. My current solution is to impersonate, copy local to
target, undo impersonation, delete locals. But i would like to be able to
impesonate, move local to target, undo impersonation.

Nov 16 '05 #2
ahh, but when i am impersonating the user that has access to the remote
drive, i can still create directories

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Daniel,

If you don't have full rights for a move in this manner, then you will
have to switch impersonation contexts. You can not have the rights merged
from two different users, as the current thread only runs in one user
context.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <so*******************@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Is it possible to retain local file system read, write, delete access
while
impersonating for access to a remote drive in a different domain? I need to
be able to move files from a local computer to a remote computer. do i
have
to copy them from the local computer to the remote computer then delete
them
fromt the local computer after undo-ing the impersonation? Or is there a
way
to retain access to both the local computer and the remote computer by
while
impersonating the use that has access to the remote computer? The
File.Move
requires read and write access to both the filesystem of the source and
the
destination because it deletes the file from the source when it is copied to
the destination. My current solution is to impersonate, copy local to
target, undo impersonation, delete locals. But i would like to be able to impesonate, move local to target, undo impersonation.


Nov 16 '05 #3
and i can still create directories in the local file system and add files to
my created directory, it only chokes when i try to add/change files in the
existing directories

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Daniel,

If you don't have full rights for a move in this manner, then you will
have to switch impersonation contexts. You can not have the rights merged
from two different users, as the current thread only runs in one user
context.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <so*******************@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Is it possible to retain local file system read, write, delete access
while
impersonating for access to a remote drive in a different domain? I need to
be able to move files from a local computer to a remote computer. do i
have
to copy them from the local computer to the remote computer then delete
them
fromt the local computer after undo-ing the impersonation? Or is there a
way
to retain access to both the local computer and the remote computer by
while
impersonating the use that has access to the remote computer? The
File.Move
requires read and write access to both the filesystem of the source and
the
destination because it deletes the file from the source when it is copied to
the destination. My current solution is to impersonate, copy local to
target, undo impersonation, delete locals. But i would like to be able to impesonate, move local to target, undo impersonation.


Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Robert Tarantino | last post: by
1 post views Thread by Leonid | last post: by
2 posts views Thread by Jerad Rose | last post: by
2 posts views Thread by LiveCycle | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.