Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Group Policies / How to Disable NetBIOS and LLMNR Protocols in Windows Using GPO?

February 27, 2023 Group PoliciesSecurityWindows 10Windows Server 2019

How to Disable NetBIOS and LLMNR Protocols in Windows Using GPO?

The broadcast protocols NetBIOS over TCP/IP and LLMNR are used in most modern networks only for compatibility with legacy Windows versions. Both protocols are susceptible to spoofing and MITM attacks. In the Metasploit there are ready-made modules that allow you to easily exploit vulnerabilities in the broadcasting NetBIOS and LLMNR protocols to intercept user credentials in the local network (including NTLMv2 hashes). To improve your network security, you need to disable these protocols on the domain network. Let’s figure out how to disable LLMNR and NetBIOS protocols in Windows 10/Windows Server 2019 manually or through Group Policies.

Contents:
  • Link-Local Multicast Name Resolution (LLMNR) Protocol
  • NetBIOS Over TCP/IP Protocol
  • Disabling LLMNR on Windows Using GPO
  • Disabling NetBIOS over TCP/IP on Windows 10/Windows Server 2019
  • How to Disable NetBIOS Over TCP/IP via Group Policy?

Link-Local Multicast Name Resolution (LLMNR) Protocol

LLMNR (UDP/5355, Link-Local Multicast Name Resolution) is used in all Windows versions starting from Vista and allows IPv6 and IPv4 clients to resolve the names of neighboring computers without using DNS server due to broadcast requests in the local L2 network segment. This protocol is automatically used if DNS is unavailable (in Windows workgroups this protocol is used for Network Discovery). So if there are DNS servers in the domain, this protocol is not needed.

NetBIOS Over TCP/IP Protocol

NetBIOS over TCP/IP or NBT-NS (UDP/137,138;TCP/139) is a broadcast protocol being a predecessor of LLMNR and used in the local network to publish and search for resources. By default, NetBIOS over TCP/IP support is enabled for all network interfaces in all Windows versions.

On Windows, you can display NetBIOS statistics and current TCP/IP connections over NBT using the nbtstat command. In order to get the computer name by its IP address:

nbtstat -A 192.168.131.190

nbtstat discover computers in LAN using netbios

As you can see, the nbtstat found a computer on the local network using the NetBIOS protocol and returned its name.

You can display all records about neighboring computers on the same local network in the NetBIOS cache:

nbtstat -c

NetBIOS and LLMNR protocols allow computers on the local network to find each other if the DNS server is unavailable. Perhaps they are needed in a workgroup environment, but in a domain network both of these protocols can be disabled.

Tip. Before mass implementation of these policies in the domain, we strongly recommend to test the computers and servers with disabled NetBIOS and LLMNR. And if there are usually no problems with disabling LLMNR, then disabling NetBIOS can paralyze the operation of legacy devices.

Disabling LLMNR on Windows Using GPO

You can disable the LLMNR protocol on a Windows computer locally via the registry using the following PowerShell commands:

New-Item "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT" -Name DNSClient  -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" -Name EnableMultiCast -Value 0 -PropertyType DWORD  -Force

In the domain environment, LLMNR broadcasts can be disabled on computers and servers using Group Policy. To do it:

  1. Open the gpmc.msc, create a new GPO or edit an existing one that is applied to all workstations and servers;
  2. Go to Computer Configuration -> Administrative Templates -> Network -> DNS Client;
  3. Enable  Turn off multicast name resolution policy by changing its value to Enabled;
  4. Wait while the GPO settings on clients are updated, or manually update them using the command: gpupdate /force
Or you can use GPP to deploy the EnableMulticast = 0 registry parameter on domain computers (on the reg key HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient).

Disabling NetBIOS over TCP/IP on Windows 10/Windows Server 2019

Note. NetBIOS may be used by legacy Windows versions (2000, XP, etc.) and some non-Windows devices, therefore it should be tested in each specific environment before disabling.

You can manually disable NetBIOS on Windows as follows:

  1. Open network connection properties
  2. Select TCP/IPv4 and open its properties
  3. Click Advanced, then go to WINS tab and select Disable NetBIOS over TCP
  4. Save the changes.

Disable NetBIOS over TCP on connection properties

If you have multiple network adapters (or VLANs) on your computer, you will need to disable NetBIOS in the properties of each of them.

You can check the NetBIOS over TCP/IP status for network adapters from the Windows command prompt:

ipconfig /all |find "NetBIOS"

NetBIOS over Tcpip . . . . . : Disabled

You can disable NetBIOS for the specific network adapter through the registry as well. Each network adapter has a separate registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces containing its TCPIP_GUID.

To disable NetBIOS for the specific adapter, go to its reg key and change the value of NetbiosOptions parameter to 2 (it is 0 by default).

NetbiosOptions - disabling netbios via registry

You can disable NetBIOS on the domain clients receiving IP addresses from a Windows DHCP server using a special DHCP option.

  1. Run the dhcpmgmt.msc console, connect to the DHCP server and select Scope Option zone settings (or server – Server Options);
  2. Go to the Advanced tab and select Microsoft Windows 2000 Options in the Vendor class dropdown list;
  3. Enable 001 Microsoft Disable Netbios Option and change its value to 0x2.

001 Microsoft Disable Netbios Option - dhcp

How to Disable NetBIOS Over TCP/IP via Group Policy?

There is no separate GPO option that allows to disable NetBIOS over TCP/IP for all network adapters in Group Policy Editor or the latest version of Administrative Templates for Windows 10/Windows Server 2019. Use the following PowerShell logon script to completely disable NetBIOS for all network adapters:

$regkey = "HKLM:SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces"
Get-ChildItem $regkey |foreach { Set-ItemProperty -Path "$regkey\$($_.pschildname)" -Name NetbiosOptions -Value 2 -Verbose}

Save this code to disableNetbios.ps1 file, copy it to your GPO directory and run on clients via Computer Configuration -> Policies -> Windows Settings -> Scripts -> Startup- > PowerShell Scripts.

If your current PowerShell execution policy is blocking this script from running on Windows computers, you must sign the PS1 script or run it in bypass mode.

disable netbios using powershell script on gpo

Note. For this change to take effect, you have to enable/disable network adapters or restart the computer.

Then open a command prompt and run the following command in order to check that NetBIOS is disabled for your network adapters (except for tunnel interfaces):

wmic nicconfig get caption,index,TcpipNetbiosOptions

13 comments
7
Facebook Twitter Google + Pinterest
previous post
Enable Windows Lock Screen after Inactivity via GPO
next post
Read and Write Data to Excel File with PowerShell

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

13 comments

Saying Goodbye to NetBIOS - 10-D Security April 13, 2018 - 6:49 pm

[…] Disabling NetBIOS: https://support.microsoft.com/en-nz/help/313314/how-to-disable-netbios-over-tcp-ip-by-using-dhcp-server-options https://woshub.com/how-to-disable-netbios-over-tcpip-and-llmnr-using-gpo/ […]

Reply
jp February 27, 2020 - 8:12 am

You can actually wildcard the Interfaces for the WINS registry value, turning this into a neat one liner without looping:
set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\tcpip* -Name NetbiosOptions -Value 2

Reply
Robert May 7, 2020 - 9:42 am

thanks. this helped me.

Reply
axel April 5, 2023 - 9:38 am

missed: -Path after set-itemproperty

should work:
set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\tcpip* -Name NetbiosOptions -Value 2

Reply
My hometown was hit with Ransomware | Brad Proctor September 3, 2020 - 2:56 pm

[…] LLMNR (Link-Local Multicast Name Resolution) and NBNS […]

Reply
Eric July 16, 2021 - 5:45 pm

Regarding this section:
“You can disable the LLMNR protocol on a Windows computer locally via the registry using the following PowerShell commands:”
You will probably find this results in the GPO setting coming out as “Not Configured” instead of Enabled.
I don’t know why this is, but I have replicate the failure dozens of times that I then have to fix, and I can only fix by going into GPEdit on the client and change the setting to Enabled.
I’ve tried exporting and importing the key – it’s a 50-50 success rate, thus not worth the effort.
Web crawling has found others have had the same issue, but the answers are always apply a domain GPO, which doesn’t help if you don’t have a domain.

Reply
Richard November 8, 2021 - 11:39 am

The specified GPO setting only disabled LLMNR broadcasts, but does not disable LLMNR itself.
To do this, you need to enable the setting “Turn off multicast name resolution”, which is also located in Network > DNS Client.

Reply
Michael March 15, 2022 - 2:30 pm

“Disabling LLMNR on Windows Using GPO” –> Why you use “Turn off smart multi-homed name resolution” instead of “Turn off multicast name resolution”. When I read the description of those GPOs the last one seems to be right.

Reply
admin March 16, 2022 - 5:43 am

You’re right, thanks!

Reply
Chris Hozee May 10, 2022 - 12:47 pm

Is a reboot really required after disabling netbios with powershell?

Reply
TM September 8, 2022 - 1:18 am

You can disable/reenable the NIC. But you need to do something for it to reread its config and disable Netbios.

Reply
nd September 8, 2022 - 6:47 pm

The DHCP options haven’t worked for any OS past XP fyi. The DHCP options can be set, but they are pretty useless unless you suddenly have a legacy client show up.

Reply
SysAdmin-E November 21, 2022 - 3:27 am

It worked for me. Make sure you use “Microsoft Windows 2000 Options” in the DHCP options (yes, Windows 2000). My DHCP server is Windows Server 2012 R2 and clients are Windows 10.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Updating List of Trusted Root Certificates in Windows
  • Configure Google Chrome Settings with Group Policy
  • How to Find the Source of Account Lockouts in Active Directory
  • How to Hide or Show User Accounts from Login Screen on Windows 10/11?
  • How to Disable or Enable USB Drives in Windows using Group Policy
  • Configuring Proxy Settings on Windows Using Group Policy Preferences
  • Changing Default File Associations in Windows 10 and 11
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top