DTLknowsWhy — User Guide v2.1

A practical guide to installing, running, and interpreting DTLknowsWhy 2.1 — from a first local snapshot to a full two-machine causal comparison.

version2.1.0 date7 June 2026 platformWindows 10 / 11 runtimePython 3.10+ languagesfr / en licenseMIT

Preface

This guide explains how to use DTLknowsWhy to diagnose Windows network and SMB problems. It covers the graphical interface, all command-line modes, the three output file formats, the expert diagnosis and comparative analysis tools, and a set of step-by-step procedures for the most common troubleshooting scenarios.

For complete module and API documentation, refer to the companion DTLknowsWhy Reference Manual.

Intended Audience

This guide is for system administrators and support staff managing Windows 10 and 11 workstations, and for network administrators diagnosing SMB, DNS, and connectivity issues. No Python development experience is required. Basic familiarity with the Windows command prompt is assumed.

Conventions

ConventionMeaning
monospaceCommands, file names, and text to type exactly as shown
italicVariable text: substitute the actual value
BoldKey term or important emphasis
[option]Optional argument; do not type the brackets
Note: All IP addresses and hostnames in examples are fictitious.
Caution: Boxes like this highlight steps that can cause data loss or security exposure if not followed carefully.
DocumentDescription
DTLknowsWhy Reference ManualComplete command syntax, module reference, and snapshot format specification
NetDTL Reference ManualPHP/MySQL agentless network inventory web application
DTLsaysWhat Reference ManualWindows system inventory tool
README.mdQuick-start summary in the repository root

Chapter 1 — Getting Started

1.1 Overview

DTLknowsWhy is a Windows diagnostic and expert analysis tool. Most diagnostic tools answer: "What is configured on this machine?" DTLknowsWhy is designed to answer: "Why is this problem occurring?"

Run it on a machine to get an immediate picture of its configuration: OS version, network profile, IP settings, key Windows services, and basic connectivity. Optionally point it at a second machine to retrieve its full remote snapshot via the built-in agent, then compare the two configurations to identify the probable cause of the difference.

Every collection run produces three files: a JSON snapshot, a plain-text report, and a dark-themed HTML report. All output is available in French and English.

ToolPurpose
DTLknowsWhy.exeGUI: situation selector, target entry, language picker, findings pane
DTLknowsWhy-CLI.exe / agent.pyCLI: same pipeline, console output, scriptable
DTLknowsWhy-Agent.exeRemote agent: runs on the target machine; delivers its snapshot over HTTP
expert.pyAnalyses a single snapshot; emits findings with remediation steps
compare.pyCompares two snapshots; identifies what differs between a working and a failing machine

1.2 What's New in Version 2.1

Works on any Windows language edition

Previous versions parsed ipconfig /all text output using French-language labels and therefore worked correctly only on French Windows. Version 2.1 replaces this engine entirely with structured PowerShell and CIM data. IP address, subnet mask, gateway, DNS servers, DHCP status, and NetBIOS status are now collected reliably on any Windows locale.

Backward compatibility: The JSON snapshot structure is unchanged. Existing expert rules, reports, and analysis modules continue to work without modification.

Graphical user interface

The new DTLknowsWhy.exe GUI presents a situation checklist, a target entry field, a language selector, a live progress log, and a structured findings pane. Select one or more situations that describe your problem, optionally enter the IP or hostname of the machine under investigation, and click Run diagnosis.

1.3 Requirements

No dependencies: Copy the project folder to any Windows machine with Python and run immediately. No virtual environment, no internet access required.

1.4 Installation

No installer is required. Copy the project folder to the target machine. The compiled executables (DTLknowsWhy.exe, DTLknowsWhy-CLI.exe, DTLknowsWhy-Agent.exe) can be run directly. The Python source files require Python 3.10+ to be installed.

All output files are written to the directory from which the tool is invoked. Use a dedicated working directory to keep snapshots and reports organised.

1.5 Quick Start

GoalCommand
Open the GUIDTLknowsWhy.exe
Local snapshot, English reportpython agent.py --snapshot --lang en
Local snapshot + remote agent querypython agent.py --target 172.17.7.3 --lang en
Expert diagnosis on the latest snapshotpython expert.py --lang en
Compare two machinespython compare.py REF_snap.json TARGET_snap.json --lang en
Start the remote agent (interactive)DTLknowsWhy-Agent.exe --listen
Install remote agent as Windows serviceDTLknowsWhy-Agent.exe install

1.6 Language Selection

DTLknowsWhy supports French and English for all output: report labels, diagnostic messages, GUI elements, and comparator findings.

In the GUI: select the language from the combo box in the right panel before running the diagnosis. The selection applies immediately to all labels and to the generated reports. In the CLI: pass --lang en or --lang fr to any command. The default is en for the compiled executables and fr for compare.py.

OS independence: The language selection is completely independent from the Windows display language. A French Windows user can generate English reports, and vice versa.

Chapter 2 — Operating Modes

2.1 — GUI Mode

The graphical interface is the recommended starting point for interactive troubleshooting. It provides a structured workflow and displays findings in a readable format without requiring command-line knowledge.
Launch
DTLknowsWhy.exe [--target IP_OR_HOST] [--lang {fr,en}]
Workflow
Situations
SituationTarget requiredDescription
SMB-001NoMachine invisible in network neighbourhood despite working SMB access
SMB-002Yes\\IP\share works but \\NAME\share fails — name resolution broken
SMB-003YesAuthentication refused after reinstall (error 86 or 1326)
LOCAL-NETWORKNoGateway unreachable, wrong IP, DHCP failure, or Public profile
LOCAL-SMBNoLanmanServer or LanmanWorkstation stopped
REMOTE-WINDOWSYesCannot access a remote Windows share (TCP 445 blocked or LanmanServer stopped)
REMOTE-DEVICEYesIdentify and classify an unknown network device
Admin rights: If the process is not elevated, the GUI asks whether to continue without administrator privileges. Some checks (SMB configuration, BitLocker status) will return incomplete data without admin rights.

2.2 — Local Snapshot (CLI)

Collects a full picture of the local machine and writes three output files. This is the starting point for any CLI diagnostic session.
Command
python agent.py --snapshot [--lang {fr,en}]
What is collected
Output

Three files named HOSTNAME_snapshot_TIMESTAMP.json, HOSTNAME_report_TIMESTAMP.txt, and HOSTNAME_report_TIMESTAMP.html. Paths are printed to the console on completion.

2.3 — Remote Target (CLI)

Runs a local snapshot plus a battery of remote diagnostic tests against a target, and if the DTLknowsWhy-Agent is running on that target, retrieves its complete snapshot and performs a causal comparison.
Command
python agent.py --target {IP|hostname} [--lang {fr,en}]
What is tested on the target
Output

Same three files as a local snapshot. If a remote agent snapshot was retrieved, it is also saved as a separate JSON file and the causal comparison is embedded in the main report.

Tip: --target always runs a local snapshot first; no need to also pass --snapshot.
MAC address: The MAC is read from the local ARP table and only resolves if the target is on the same Layer 2 segment and has been recently contacted.
Performance: Each TCP port probe uses PowerShell Test-NetConnection with a 15-second timeout. If all four ports time out, remote tests take up to 60 seconds.

2.4 — Server Mode

Starts a lightweight HTTP server on TCP port 5050. Used when you want to remotely trigger a snapshot on this machine from another machine (or from the NetDTL inventory application) without running an interactive command.
Command
python agent.py --listen
HTTP endpoint
GET http://172.17.7.10:5050/snapshot?key=DTLSECRET&lang=en

Returns HTTP 200 with the full snapshot JSON body. Writes JSON, TXT, and HTML files locally on every request.

Security: No TLS. API key (DTLSECRET) stored in plain text in agent/server.py. Change the default key before deployment. Use only on trusted local networks. TCP port 5050 must be open in the Windows Firewall (see Appendix C).

2.5 — Remote Agent

DTLknowsWhy-Agent runs on the target machine and exposes the same HTTP snapshot endpoint as server mode. Can run interactively for one-off sessions or as a persistent Windows service.
Interactive mode
DTLknowsWhy-Agent.exe --listen
Windows service mode
DTLknowsWhy-Agent.exe install
DTLknowsWhy-Agent.exe start

DTLknowsWhy-Agent.exe stop
DTLknowsWhy-Agent.exe remove
When to use each mode
ModeSuitable for
Interactive (--listen)One-off or occasional remote diagnostics; testing the agent
Windows serviceMachines always available for remote collection; NetDTL integration
SmartScreen: On first execution, Windows Defender SmartScreen may block the agent because it is not digitally signed. See Appendix D.

Chapter 3 — Output Files

Every collection run writes three files to the current directory. The files share the same base name, encoding the local hostname and a timestamp.

3.1 — JSON Snapshot

Raw structured data. The primary input format for expert.py and compare.py. Suitable for archiving, scripting, or version-controlled troubleshooting records.
Filename
HOSTNAME_snapshot_YYYYMMDD_HHMMSS.json
Top-level keys (v2.1)
Format stability: The core keys (system, network, tests, services) are unchanged from v2.0. Snapshots collected with earlier versions can be analysed by the v2.1 expert and compare tools without conversion.

3.2 — Text Report

Human-readable plain text, UTF-8 encoded, with fixed-width label columns. All section labels are translated according to the --lang flag. Suitable for printing, attaching to a support ticket, or including in an email.
Filename
HOSTNAME_report_YYYYMMDD_HHMMSS.txt
Sections
Sample (English)
DTLknowsWhy Technical Report
==================================================
Generated: 2026-06-07 09:34:42

==================================================
LOCAL MACHINE
==================================================

Identity
--------------------------------------------------
Hostname            : PREDATOR
Username            : didier
Administrator       : Yes

System
--------------------------------------------------
Operating System    : Windows 11 Pro 23H2
Build               : 22631

Network
--------------------------------------------------
Profile             : Private
IPv4 Address        : 172.17.7.10
Subnet Mask         : 255.255.255.0
Gateway             : 172.17.7.1
DNS Servers         : 172.17.7.1
DHCP                : No
NetBIOS             : Yes (via DHCP)

3.3 — HTML Report

Self-contained HTML with a dark terminal theme. Open in any browser — no server required. Values are colour-coded: green for positive, red for negative, grey for unknown. The Windows services and local tests sections are collapsible.
Filename
HOSTNAME_report_YYYYMMDD_HHMMSS.html
Sections
Logo: The report loads netdtl_logo.png from the same directory via a relative path. Place the logo alongside the report for it to display correctly.

Chapter 4 — Expert Tools

The expert tools work on previously collected snapshots. They do not collect new data; they analyse what was already captured and produce structured diagnostic output.

4.1 — Expert Diagnosis

Analyses a single snapshot and outputs structured findings with levels and remediation steps. Designed for quick identification of network configuration issues on one machine.
Commands
# Analyse the latest snapshot automatically
python expert.py --lang en

# Analyse a specific snapshot
python expert.py PC-BEN-002_snapshot_20260607_093442.json --lang en
Auto-detection

If no snapshot file is specified, expert.py automatically selects the most recently modified *_snapshot_*.json file in the current directory. The typical two-step CLI workflow is: run python agent.py --snapshot, then run python expert.py with no arguments.

Finding levels
LevelMeaningAction
[OK]No issue for this checkNone
[INFO]Informational — worth notingNone
[WARN]Potential issue — may cause problemsReview the remediation
[FAIL]Confirmed problem — likely causing the symptomApply the remediation immediately
What is analysed

4.2 — Comparative Analysis

Compares two snapshots — one from a reference machine (working correctly) and one from the machine under investigation — to identify which configuration differences most likely explain the problem. Available in French and English via --lang.
Command
python compare.py REF_snap.json TARGET_snap.json [--lang {fr,en}]
Typical workflow

PC B cannot access network shares that PC A reaches without difficulty. Collect a snapshot on each machine, copy both JSON files to the same directory, and run compare.py. The output will flag whether the cause is a Public network profile, a stopped SMB service, a gateway connectivity problem, a security product difference, or a configuration parameter mismatch.

Finding tags
Tag (English)Meaning
[CONFIRMED CAUSE]The difference directly causes the problem (e.g. SMB service stopped on target)
[PROBABLE CAUSE]A configuration known to block the feature in question
[POSSIBLE CAUSE]A difference that may contribute depending on the scenario
[OBSERVED]Factual observation (e.g. accessible shares listed); no issue implied
[TO VERIFY]Notable configuration warranting manual verification
[MISSING INFORMATION]Field absent from target snapshot; no conclusion possible
What is compared
Directional: Only deviations where the target differs from the reference are reported. If both machines have the same misconfiguration, it will not be flagged. Run expert.py on each snapshot individually for an absolute analysis.

Chapter 5 — Troubleshooting Procedures

This chapter provides step-by-step procedures for the most common Windows SMB and network issues identified during operational use of DTLknowsWhy.

5.1 — SMB-001: Machine Invisible in Network Neighbourhood

The machine does not appear in Windows Explorer under "Network", but direct access via \\IP or \\NAME works. net view may return error 6118.
Diagnosis

Select SMB-001 in the GUI and run the diagnosis on the invisible machine, or run python agent.py --snapshot --lang en on it.

Common cause

FDResPub (Function Discovery Resource Publication) is stopped. Network neighbourhood visibility is handled by FDResPub and fdPHost, which are completely separate from the SMB protocol. SMB can work perfectly while the machine is invisible in Explorer.

Resolution
sc config fdrespub start= delayed-auto
net start fdrespub
Note on error 6118

The error "the list of servers for this workgroup is not currently available" (error 6118 from net view) is normal and expected since Windows 10 1709. The SMBv1 network browser service is disabled by default. Do not attempt to re-enable SMBv1. Use \\MACHINE_NAME or \\IP directly in Explorer.

5.2 — SMB-002: Access by IP Works, Access by Name Fails

\\192.168.x.x\share works but \\MACHINE_NAME\share fails or is very slow. SMB itself is functioning; only name resolution is broken.
Diagnosis
ping -4 MACHINE_NAME
nslookup MACHINE_NAME
nbtstat -A IP_ADDRESS
Common causes
Resolution

If ping by name works but name-based SMB access is still slow: the delay is usually caused by Windows enumerating all shares when you browse \\NAME rather than going directly to a specific share. Map shares directly at logon to avoid the enumeration delay:

net use Z: \\MACHINE_NAME\share /persistent:yes

Also check the Credential Manager for stale tokens that may cause repeated failed authentication attempts before the correct account is tried.

5.3 — SMB-003: Authentication Refused (Error 86 or 1326)

After a Windows reinstall, credentials are refused with "The specified network password is not correct" (error 86) or "The username or password is incorrect" (error 1326), even though the same credentials work from other machines.
Step 1: clear cached credentials
net use * /delete /y

Then open Control Panel → Credential Manager → Windows Credentials and delete all entries for the target machine (including any MicrosoftAccount:target=... entries). After a reinstall with a Microsoft account, Windows may cache an MSA token that takes priority over local or domain credentials.

Step 2: use the correct account format
net use \\MACHINE\IPC$ /user:DOMAIN\firstname.lastname

Use the domain name (e.g. SC\anne.honnyme), not the local machine name (MACHINE\Anne). After a reinstall in Workgroup mode the machine no longer resolves the domain context automatically.

Step 3: check LmCompatibilityLevel

If error 1326 persists with the correct account format, check whether LmCompatibilityLevel is absent from the registry (DTLknowsWhy will show null in the snapshot). A fresh Windows install with the key absent uses the system default (NTLMv2 only), which some older servers or Workgroup configurations may reject.

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" `
  -Name LmCompatibilityLevel -Value 1 -Type DWord
# Restart required

Value 1 enables LM+NTLM+NTLMv2 negotiation. If this resolves the issue, the target server does not accept NTLMv2 alone.

5.4 — TCP 445 Blocked: net view Error 53 by IP

Ping to the target IP succeeds, but net view \\IP returns "The network path was not found" (error 53). Because the error occurs using an IP address (not a name), name resolution is not the issue — this is a pure TCP block on port 445.
Confirm the block
Test-NetConnection IP_TARGET -Port 445

If TcpTestSucceeded: False, proceed to the checks below.

Check LanmanServer on the target
sc query lanmanserver

If not Running: sc start lanmanserver

Check Windows Firewall on the target

Verify that the inbound rule for TCP port 445 exists and is enabled. An easy test: temporarily disable the Windows Firewall on the target and retry. If access is restored, the firewall is the cause. Re-enable the firewall and create the appropriate inbound rule.

Note on IPv6 ping

If ping MACHINE_NAME resolves to an IPv6 link-local address (fe80::...), this does not confirm that SMB is accessible on IPv4. Always verify with ping -4 MACHINE_NAME to get the IPv4 address, then test Test-NetConnection IP -Port 445.

5.5 — Network Discovery Keeps Turning Itself Off

The network profile is Private and all discovery services (FDResPub, fdPHost, SSDPSRV, upnphost, Dnscache) are Running, but the "Network Discovery" checkbox in Windows settings resets to off immediately after being enabled.
Check the firewall rules
Get-NetFirewallRule | Where-Object {
    $_.DisplayGroup -like '*Network Discovery*' -or
    $_.DisplayGroup -like '*Découverte*'
} | Select-Object DisplayName, DisplayGroup, Enabled

If only Wi-Fi Direct rules appear and no "Network Discovery" group rules are listed, the rules have been deleted (not just disabled). This can happen after security hardening, a GPO, or a third-party security tool.

Resolution: re-enable the deleted rules
# English Windows
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes

# French Windows
netsh advfirewall firewall set rule group="Découverte du réseau" new enable=Yes

If the command reports "No rules match the specified criteria", the rules were fully deleted. Reset the firewall to defaults or import the rules from a healthy machine. If the rules reappear but the checkbox resets again after a few minutes, a third-party security tool (e.g. an EDR or antivirus) is re-applying a policy. Identify the tool and configure an exception.

GPO check

Run gpresult /r. If "Domain type" shows "Windows NT 4" or "Standalone workstation" with no applied GPOs listed, the issue is not Group Policy — it is a local firewall or security tool.

Appendices

Appendix A — Administrator Rights

DTLknowsWhy works without administrator privileges, but some data will be incomplete. The following table shows what is affected.

FeatureWithout adminWith admin
System info, network, local testsFull dataFull data
Service status queriesUsually full; may be partial on hardened machinesFull
SMB client/server configurationMay be inaccessibleFull
BitLocker statusnull in snapshotFull
Security Center queriesMay require elevationFull
is_admin fieldfalse — expert engine emits [WARN]true

To run as administrator: right-click the command prompt or PowerShell icon, choose Run as administrator, then run the tool from that elevated session.

Appendix B — Target Classification

After remote tests complete, the tool assigns a target_type to the tested machine. Rules are applied in order; the first match wins.

ClassificationBadgeCondition
probable_mobile_appleBlueResolved hostname contains iphone or ipad
probable_mobile_androidBlueResolved hostname contains android
probable_windowsGreenTCP 445 or TCP 139 open — likely a Windows workstation
probable_deviceOrangeTCP 80 or TCP 443 open — network appliance or smart device
unknown_network_deviceOrangeMAC resolved but no recognisable open ports
unknown_hostGreyPing succeeded but no MAC and no open ports
unreachableRedPing failed
Note on TTL: If nmap or a verbose ping reports a TTL of approximately 62–63 for a machine you expected to be a Windows PC, it is almost certainly a Linux-based appliance or network device (initial TTL 64, minus hops). Windows machines start at TTL 128. DTLknowsWhy will classify it as probable_device or unknown_network_device based on the open ports; verify with arp -a to identify the manufacturer from the MAC address.

Appendix C — Firewall Configuration for the Remote Agent

DTLknowsWhy-Agent listens on TCP port 5050. This port must be open inbound on the Windows Firewall of the target machine before the diagnostic workstation can connect.

Create the rule from an elevated command prompt on the target machine:

netsh advfirewall firewall add rule name="DTLknowsWhy Agent" ^
  dir=in action=allow protocol=TCP localport=5050

Or via the graphical interface: Windows Defender Firewall → Advanced Settings → Inbound Rules → New Rule → Port → TCP → 5050 → Allow the connection.

Appendix D — SmartScreen Warning

On first execution, Windows Defender SmartScreen may display:

Windows protected your PC.
Microsoft Defender SmartScreen prevented an unrecognized app from starting.

This is expected for executables that are not digitally signed. To proceed:

Appendix E — Known Limitations

Appendix F — Version History

VersionDateChanges
2.1.07 June 2026Language-independent network collection (PowerShell/CIM); Tkinter GUI with language selector; lm_compatibility_level and bitlocker_status collector keys; fully internationalised comparator; 15 expert rules from operational sessions; 280+ i18n keys; backward-compatible JSON format
2.0.06 June 2026Remote agent; Windows service mode; HTTP snapshot endpoint; local/remote causal comparison; enhanced HTML reports; expert rule engine
1.2.0Experimental remote snapshot server
1.0.0Initial release: local diagnostics and reporting