Author: vlonkar | Posted on: 10/20/2008 8:57:35 AM | Views : 268

Hi,

Here is the situation:

We are using ASP.NET 3.5 - VB.NET - visual studio 2008 SP1 - Windows Vista (Debug) - Window 2003 (Prod)

There is a virtual folder in our site. This folder points to a drive on remote server. We have assigned this folder using UNC conventions "\\server1\drive1\folder1". We are trying to write some files to this folder from a seperate thread. We have one user name (domain1\user1) that has full permissions to the drive on the remote server. we are using following code in the new thread to impersonate this user:

Thread.CurrentPrincipal= New GenericPrincipal(New GenericIdentity("\\domain1\user1"), New String() {"SystemUser"}))

In the debugger we can see the properties of the Thread being assinged correctly.

?Thread.CurrentPrincipal.Identity.AuthenticationType
""
?Thread.Curr ...

Go to the complete details ...