Note that there are some explanatory texts on larger screens.

plurals
  1. POUNC LogonUser: Unknown user or bad password
    primarykey
    data
    text
    <p>I have a weird scenario here. My app connects to a fileserver to list the files from a directory using UNC. It has been working for the past couple of years without any problem. Recently, my network admin rebooted the server as a result of which I started getting LogonUser : Unknown user or bad password error. As per the network admin, everything is set up correctly for the domain user account. The username and password are all correct. Is there anything I need to change in the code below?</p> <pre><code>const int LOGON32_LOGON_INTERACTIVE = 2; const int LOGON32_LOGON_NETWORK = 3; const int LOGON32_LOGON_BATCH = 4; const int LOGON32_LOGON_SERVICE = 5; const int LOGON32_LOGON_UNLOCK = 7; const int LOGON32_LOGON_NETWORK_CLEARTEXT = 8; const int LOGON32_LOGON_NEW_CREDENTIALS = 9; const int LOGON32_PROVIDER_DEFAULT = 0; [DllImport("advapi32.dll", SetLastError = true)] public static extern int LogonUser( string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, out IntPtr phToken ); [DllImport("advapi32.dll", SetLastError = true)] public static extern int ImpersonateLoggedOnUser( IntPtr hToken ); [DllImport("advapi32.dll", SetLastError = true)] static extern int RevertToSelf(); [DllImport("kernel32.dll", SetLastError = true)] static extern int CloseHandle(IntPtr hObject); int TResult = LogonUser(ConfigurationManager.AppSettings["ServerUserName"].ToString(), @"\\server\folder", ConfigurationManager.AppSettings["ServerPassword"].ToString(), LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, out lnToken); </code></pre> <p>Please advise on what else I should be checking with my network admin. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload