Disable NetBIOS and LLMNR Protocols in Windows Using GPO - How to do it

Disable NetBIOS and LLMNR Protocols in Windows Using GPO - How to do it
Are you trying to disable NetBIOS and LLMNR Protocols? 

We can help you.

The broadcast protocols NetBIOS over TCP/IP and LLMNR are used in most modern networks only for compatibility with legacy Windows versions.

However, both protocols are susceptible to spoofing and MITM attacks. For improving network security, we can disable these protocols on the domain network.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to use Windows servers to disable both NetBIOS and LLMNR.

In this context, we shall look into to method to disable these protocols in Windows.

How to Disable NetBIOS and LLMNR Protocols ?

NetBIOS and LLMNR protocols allow computers on the local network to find each other if the DNS server is unavailable.

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.

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.

They are needed in a workgroup environment. 

However, in a domain network, we can disable both of these protocols.

1. Disabling LLMNR on Windows Using GPO

We 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

Following are the steps to disable using Group Policy:

i. First, open the gpmc.msc, create a new GPO or edit an existing one that is applied to all workstations and servers.

ii. Then go to Computer Configuration and take Administrative Templates.

iii. From there, go to Network and take DNS Client.

iv. After that, we need to enable Turn off smart multi-homed name resolution policy by changing its value to Enabled.

v. Wait while the GPO settings on clients are updated or manually update them using the following command:

$ gpupdate /force

2. Disabling NetBIOS over TCP/IP via Group Policy

There is no separate GPO option that allows disabling NetBIOS over TCP/IP for all network adapters in Group Policy Editor.

We can 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}

We can save this code to disableNetbios.ps1 file, copy it to the GPO directory.

To run on clients via Computer Configuration we can do the following steps:

i. Go to Policies in the computer configuration

ii. And take Windows Settings

iii. From there go to Scripts

iv. After that take Startup and go to PowerShell Scripts.

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

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

vii. Then open a command prompt and run the following command in order to check that NetBIOS is disabled for the network adapters :

wmic nicconfig get caption,index,TcpipNetbiosOptions

[Need assistance in fixing Windows errors? We can help you. ]

Who We Are ?

Most prominent, efficient, and well-performing IT companies and software solutions.

Related Posts