Windows API reference
WNetAddConnection2W
Connects a local drive letter or UNC path to a network share with optional credentials.
- Library
- Mpr.dll
- Category
- Lateral Movement
- Suspicion
- high
Detection summary
WNetAddConnection2W is not directly logged; detect the resulting SMB connection and remote-share activity instead.
- Sysmon: No Sysmon event mapped
- ETW: No ETW provider mapped
- Notes: Correlate Sysmon 3 connections and Sysmon 17/18 named-pipe activity with EDR API telemetry. Legitimate admin, backup and deployment tools use the same call.
Sources and documentation
- Microsoft Learn documentation (direct documentation)
- MITRE ATT&CK T1021.002: Remote Services: SMB/Windows Admin Shares
- Microsoft Sysmon events
Last reviewed: . Page metadata generated .
Legitimate use
IT administration, backup, deployment and monitoring tools.
Related APIs
- WNetAddConnection3W — Mpr.dll
- NetUseAdd — Netapi32.dll
- WNetCancelConnection2W — Mpr.dll