Re: Impersonation and accessing Windows file share



If you enable logon event auditing on the file server, what does the logon
failure say on that end? That may give you some clues.

Also, when you called LogonUser, what type of logon did you do? You need to
make sure you use one that gives you network credentials.

Joe K.

"Julie" <hermie@xxxxxxxxxxxxx> wrote in message
news:674C986D-5107-420D-A65C-3FC8B440766B@xxxxxxxxxxxxxxxx
I use that code and I can confirm that impersonation is impersonating the
correct user. And yes, I can access the file share as the system
account -
thanks for checking. :-)


"Luke Zhang [MSFT]" wrote:

Hello,

First, you can use the following code to determine what user the thread
is
executing as:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

Also, you if logon as the System account on the server, can you access
the
Windows file share like "\\Myserver\Myshare"?

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)




.



Relevant Pages

  • Re: Impersonation and accessing Windows file share
    ... I can see on the Event log on my web server that the service account is ... However, on the file server, the event log shows that the user is connecting ... My Logon code looks like this: ... Dim handle As IntPtr = New IntPtr ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Impersonation and accessing Windows file share
    ... logon doesn't have network credentials. ... However, on the file server, the event log shows that the user is ... Private Declare Auto Function LogonUser Lib "advapi32.dll" (ByVal ... Dim handle As IntPtr = New IntPtr ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Locked out of server!
    ... file server pc??? ... > Arrived on site to find ALL attempts to logon to the fileserver pc being> disallowed even to domain admin. ... > "The local policy of this system does not permit you to logon> interactively" ...
    (microsoft.public.windows.server.sbs)
  • Re: Impersonation and accessing Windows file share
    ... logon doesn't have network credentials. ... However, on the file server, the event log shows that the user is ... Private Declare Auto Function LogonUser Lib "advapi32.dll" (ByVal ... Dim handle As IntPtr = New IntPtr ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Impersonation and accessing Windows file share
    ... executing as: ... Also, you if logon as the System account on the server, can you access the ... When responding to posts, please "Reply to Group" via your newsreader so ...
    (microsoft.public.dotnet.framework.aspnet.security)