Quick fix: Run Set-NetFirewallProfile -Profile Public -Enabled True; Get-NetFirewallRule -DisplayGroup “Network Discovery” | Where-Object Profile -like “*Public*” | Disable-NetFirewallRule in elevated PowerShell. Network discovery is now off on every Public profile network the PC connects to.
You want public-network protection: when on coffee shop Wi-Fi, hotel networks, or any untrusted connection, your PC shouldn’t advertise itself or browse the network. Windows’ Public profile defaults are reasonable but Network Discovery may still be partially enabled.
Affects: Windows 11 (any edition).
Fix time: 3 minutes.
Method 1: Disable via PowerShell firewall rules
- Open elevated PowerShell.
- Run:
Get-NetFirewallRule -DisplayGroup “Network Discovery” | Where-Object Profile -like “*Public*” | Disable-NetFirewallRule - Verify:
Get-NetFirewallRule -DisplayGroup “Network Discovery” | Where-Object Profile -like “*Public*” | Select-Object DisplayName, Enabled
Method 2: Disable via Settings
- Settings → Network & internet → Advanced network settings → Advanced sharing settings.
- Expand Public networks.
- Toggle Network discovery off.
- Toggle File and printer sharing off.
Method 3: Group Policy for fleet
- gpedit.msc → Computer Configuration → Windows Settings → Security Settings → Network List Manager Policies.
- Set unidentified networks to Public.
- Set User Permissions to disallow changing location.
Verification
- Connect to a Public-profile network.
- Open File Explorer → Network. Other devices don’t appear (your PC also doesn’t broadcast).
Test-NetConnection <your-public-IP> -Port 445from another device on the same network — fails (file sharing blocked).
If none of these work
If devices still discover yours, check whether mDNS/Bonjour is running (some apps install Bonjour for cross-platform discovery). Disable the Bonjour service if not needed. For chronic public-network exposure concerns, use a VPN to tunnel through trusted infrastructure regardless of the local Wi-Fi.
Bottom line: One PowerShell command disables network discovery on all Public profiles. Combine with the Settings UI for the full sharing-off picture.