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.
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
| Convention | Meaning |
|---|---|
monospace | Commands, file names, and text to type exactly as shown |
| italic | Variable text: substitute the actual value |
| Bold | Key term or important emphasis |
[option] | Optional argument; do not type the brackets |
Related Documents
| Document | Description |
|---|---|
| DTLknowsWhy Reference Manual | Complete command syntax, module reference, and snapshot format specification |
| NetDTL Reference Manual | PHP/MySQL agentless network inventory web application |
| DTLsaysWhat Reference Manual | Windows system inventory tool |
| README.md | Quick-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.
| Tool | Purpose |
|---|---|
DTLknowsWhy.exe | GUI: situation selector, target entry, language picker, findings pane |
DTLknowsWhy-CLI.exe / agent.py | CLI: same pipeline, console output, scriptable |
DTLknowsWhy-Agent.exe | Remote agent: runs on the target machine; delivers its snapshot over HTTP |
expert.py | Analyses a single snapshot; emits findings with remediation steps |
compare.py | Compares 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.
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
- Windows 10 or Windows 11
- Python 3.10 or later (standard library only — no
pip installneeded) - PowerShell 5.1 or 7+ (pre-installed on all supported Windows versions)
- Administrator privileges recommended (see Appendix A)
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
| Goal | Command |
|---|---|
| Open the GUI | DTLknowsWhy.exe |
| Local snapshot, English report | python agent.py --snapshot --lang en |
| Local snapshot + remote agent query | python agent.py --target 172.17.7.3 --lang en |
| Expert diagnosis on the latest snapshot | python expert.py --lang en |
| Compare two machines | python compare.py REF_snap.json TARGET_snap.json --lang en |
| Start the remote agent (interactive) | DTLknowsWhy-Agent.exe --listen |
| Install remote agent as Windows service | DTLknowsWhy-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.
Chapter 2 — Operating Modes
2.1 — GUI Mode
DTLknowsWhy.exe [--target IP_OR_HOST] [--lang {fr,en}]
- Select one or more situations that describe the problem (e.g. "Machine invisible in network neighbourhood", "Cannot access a remote Windows share")
- Enter the IP or hostname of the target machine if a situation requires it (marked with a star)
- Select the language for the interface and reports
- Click Run diagnosis
- Watch the progress log on the left; findings appear in the results pane on the right when complete
- Click Open HTML report to view the full report in a browser
| Situation | Target required | Description |
|---|---|---|
| SMB-001 | No | Machine invisible in network neighbourhood despite working SMB access |
| SMB-002 | Yes | \\IP\share works but \\NAME\share fails — name resolution broken |
| SMB-003 | Yes | Authentication refused after reinstall (error 86 or 1326) |
| LOCAL-NETWORK | No | Gateway unreachable, wrong IP, DHCP failure, or Public profile |
| LOCAL-SMB | No | LanmanServer or LanmanWorkstation stopped |
| REMOTE-WINDOWS | Yes | Cannot access a remote Windows share (TCP 445 blocked or LanmanServer stopped) |
| REMOTE-DEVICE | Yes | Identify and classify an unknown network device |
2.2 — Local Snapshot (CLI)
python agent.py --snapshot [--lang {fr,en}]
- System: hostname, username, admin status, Windows version and build, LmCompatibilityLevel, BitLocker status
- Network: profile name and category (Public/Private/Domain), IPv4, subnet mask, gateway, DNS servers, DHCP status, NetBIOS option and enabled flag
- Local tests: ping loopback (127.0.0.1), ping self (own IP), ping gateway
- Services: LanmanServer, LanmanWorkstation, FDResPub, fdPHost, lmhosts
- Expert diagnosis: findings from the rules engine are embedded in the snapshot JSON
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)
python agent.py --target {IP|hostname} [--lang {fr,en}]
- Ping: basic ICMP reachability
- Hostname resolution: name lookup from the IP address
- TCP port probes: ports 80 (HTTP), 139 (NetBIOS), 443 (HTTPS), 445 (SMB)
- MAC address: from the local ARP table
- Target classification: automatic type assignment
- Remote agent snapshot: if DTLknowsWhy-Agent is running on the target, its full JSON snapshot is retrieved and a causal comparison is performed automatically
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.
--target always runs a local snapshot first; no need to also pass --snapshot.Test-NetConnection with a 15-second timeout. If all four ports time out, remote tests take up to 60 seconds.2.4 — Server Mode
python agent.py --listen
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.
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.exe --listen
DTLknowsWhy-Agent.exe install
DTLknowsWhy-Agent.exe start
DTLknowsWhy-Agent.exe stop
DTLknowsWhy-Agent.exe remove
| Mode | Suitable for |
|---|---|
Interactive (--listen) | One-off or occasional remote diagnostics; testing the agent |
| Windows service | Machines always available for remote collection; NetDTL integration |
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
expert.py and compare.py. Suitable for archiving, scripting, or version-controlled troubleshooting records.HOSTNAME_snapshot_YYYYMMDD_HHMMSS.json
metadata— generation timestamp, role (local/remote), target hostnamesystem— OS, admin status, LmCompatibilityLevel, BitLocker statusnetwork— IP config, profile, NetBIOS option and enabled flagtests— local ping results (boolean)services— Windows service statusesdiagnosis— expert engine findings (embedded)remote_tests— present only when--targetwas usedcausal_comparison— present only when--targetwas usedremote_agent_snapshot— present only if the remote agent responded
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
--lang flag. Suitable for printing, attaching to a support ticket, or including in an email.HOSTNAME_report_YYYYMMDD_HHMMSS.txt
- Title and generation timestamp
- Local machine: identity, system, network, Windows services, local tests
- Expert diagnosis findings (level, message, remediation)
- Remote target (when
--targetwas used): identification, port tests, classification, interpretation - Causal comparison findings (when a remote agent snapshot was retrieved)
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
HOSTNAME_report_YYYYMMDD_HHMMSS.html
- Header bar: title, timestamp, NetDTL logo
- Local machine: identity, system, network, Windows services (collapsible), local tests (collapsible)
- Expert diagnosis (findings with level badges and remediation)
- Remote agent snapshot (if retrieved): second machine's full data in a mirrored layout
- Causal comparison (findings with cause and remediation)
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
# 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
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.
| Level | Meaning | Action |
|---|---|---|
[OK] | No issue for this check | None |
[INFO] | Informational — worth noting | None |
[WARN] | Potential issue — may cause problems | Review the remediation |
[FAIL] | Confirmed problem — likely causing the symptom | Apply the remediation immediately |
- Administrator privileges
- Gateway reachability (local connectivity)
- Network profile (Public blocks SMB and network discovery)
- LanmanServer and LanmanWorkstation service status
- FDResPub status (SMB-001: machine invisible in network neighbourhood)
- LmCompatibilityLevel value (0 = security risk; 5 = may block Workgroup SMB)
- BitLocker status (active drives: warn before any system configuration change)
- Remote target classification and SMB port accessibility (if
remote_testsis in the snapshot) - Auth error guidance for probable_windows targets with TCP 445 open (error 86/1326)
4.2 — Comparative Analysis
--lang.python compare.py REF_snap.json TARGET_snap.json [--lang {fr,en}]
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.
| 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 |
- Network profile and gateway reachability
- LanmanServer, LanmanWorkstation, FDResPub, fdPHost service status
- NetBIOS option and DNS servers
- IP topology (gateway and subnet mask)
- TCP 445 accessibility
- Security products (Bitdefender presence and fltmc filter stack)
- SMB client and server configuration parameters
- Accessible SMB shares
- Identity context (local account, domain, AzureAD Joined)
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
\\IP or \\NAME works. net view may return error 6118.Select SMB-001 in the GUI and run the diagnosis on the invisible machine, or run python agent.py --snapshot --lang en on it.
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.
sc config fdrespub start= delayed-auto
net start fdrespub
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.ping -4 MACHINE_NAME
nslookup MACHINE_NAME
nbtstat -A IP_ADDRESS
- NetBIOS disabled on one or both machines
- DNS does not contain an entry for the machine
- LLMNR disabled by policy
- FDResPub stopped (the machine is not publishing its presence)
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)
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.
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.
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
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.Test-NetConnection IP_TARGET -Port 445
If TcpTestSucceeded: False, proceed to the checks below.
sc query lanmanserver
If not Running: sc start lanmanserver
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.
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
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.
# 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.
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.
| Feature | Without admin | With admin |
|---|---|---|
| System info, network, local tests | Full data | Full data |
| Service status queries | Usually full; may be partial on hardened machines | Full |
| SMB client/server configuration | May be inaccessible | Full |
| BitLocker status | null in snapshot | Full |
| Security Center queries | May require elevation | Full |
is_admin field | false — 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.
| Classification | Badge | Condition |
|---|---|---|
| probable_mobile_apple | Blue | Resolved hostname contains iphone or ipad |
| probable_mobile_android | Blue | Resolved hostname contains android |
| probable_windows | Green | TCP 445 or TCP 139 open — likely a Windows workstation |
| probable_device | Orange | TCP 80 or TCP 443 open — network appliance or smart device |
| unknown_network_device | Orange | MAC resolved but no recognisable open ports |
| unknown_host | Grey | Ping succeeded but no MAC and no open ports |
| unreachable | Red | Ping failed |
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:
- Verify the file originates from the official DTLknowsWhy repository.
- Click More info, then click Run anyway.
- In corporate environments, request digital signing or explicit approval from your security team before wide deployment.
Appendix E — Known Limitations
- Windows only. The tool will not run on Linux or macOS.
- Single active adapter. On multi-adapter machines, only the first matching adapter's values are collected.
- ARP MAC lookup requires LAN adjacency. The target must be on the same Layer 2 segment or have been recently contacted.
- Remote tests can be slow. Each TCP port probe has a 15-second timeout. Up to 60 seconds if all four ports time out.
- Server mode writes files on every request. Each
GET /snapshottriggers a full collection and writes new output files locally. - BitLocker collection requires elevation. Without admin rights,
bitlocker_statuswill benull. - compare.py is directional. Only target deviations from the reference are reported. Run
expert.pyon each snapshot individually for an independent analysis. - HTML report logo path is relative. Place
netdtl_logo.pngin the same directory as the HTML report. - Log file in current directory.
dtlknowswhy.logis written to the invocation directory; logging silently fails if write permission is absent.
Appendix F — Version History
| Version | Date | Changes |
|---|---|---|
| 2.1.0 | 7 June 2026 | Language-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.0 | 6 June 2026 | Remote agent; Windows service mode; HTTP snapshot endpoint; local/remote causal comparison; enhanced HTML reports; expert rule engine |
| 1.2.0 | — | Experimental remote snapshot server |
| 1.0.0 | — | Initial release: local diagnostics and reporting |