internal static bool IsLogonDeniedException(Exception exception) { Win32Exception win32exception = exception as Win32Exception; return (win32exception != null) && (win32exception.NativeErrorCode == (int)SecurityStatusPalErrorCode.LogonDenied); } }