다음을 통해 공유


Configuring NetBIOS over TCP/IP

Question

Thursday, July 6, 2006 5:26 AM

How do I disable NetBIOS using netsh?

Thank you,
Alex

All replies (17)

Thursday, July 6, 2006 10:16 PM ✅Answered | 7 votes

You can edit the registry to change the NetBIOS configuration. Under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters\Interfaces, find the GUID(s) with NetbiosOptions set to 0 and set them to 2. This is the equivalent of selecting disabled in the GUI.

With Server Core you can use regedit and connect remotely to set this or use the reg.exe command line tool.

Andrew


Friday, February 15, 2008 9:26 AM ✅Answered | 9 votes

 

Hi,

 

try this commands....

 

for list of interfaces:

wmic nicconfig get caption,index,TcpipNetbiosOptions

 

"index number" use in next command:

wmic nicconfig where index=1 call SetTcpipNetbios 2

 

SetTcpopNetbios option:

0 - Use NetBIOS setting from the DHCP server

1 - Enable NetBIOS over TCP/IP

2 - Disable NetBIOS over TCP/IP

 


Thursday, July 6, 2006 9:13 PM

I'm not aware of a way to do this with netsh. You can use DHCP to set this remotely.

 

Andrew


Thursday, July 6, 2006 9:18 PM

This server does not use DHCP. Any other way to configure NetBIOS?


Wednesday, May 16, 2007 1:16 PM

Is it possible to disable the Netbios using Netsh?


Friday, April 18, 2008 8:58 PM

Thank you, much better solution then the registry.  Is there a way to silently execute without Y/N prompt?


Saturday, April 26, 2008 10:03 AM | 3 votes

of corse.....

 

Code Snippet

wmic /interactive:off + commands to run

wmic /interactive:off nicconfig where index=1 call SetTcpipNetbios 2

 

 

 

Pavel P.


Thursday, July 9, 2009 7:21 PM | 2 votes

To automatically turn NETBIOS off on all adapters that support netbios, use the following:

wmic /interactive:off nicconfig where TcpipNetbiosOptions=0 call SetTcpipNetbios 2
wmic /interactive:off nicconfig where TcpipNetbiosOptions=1 call SetTcpipNetbios 2


Thursday, March 18, 2010 9:37 PM | 1 vote

I had issues trying to set an XP box with WMIC command-line utility as well.  If the box is Vista or 'better' you can use WMIC to do just about anything.

Here's what I use - not much different than everyone else's suggestion:

wmic nicconfig where (IPEnabled=TRUE) call SetTcpipNetbios 1
wmic nicconfig where (IPEnabled=TRUE) call SetWINSServer "IP1","IP2"
wmic nicconfig where (IPEnabled=TRUE) call SetDNSServerSearchOrder ("IP1","IP2","IP3","IP4","IP5")
wmic nicconfig where (IPEnabled=TRUE) call FlushDNS

Obviously, I've sanitized our network settings from this.

You can search through the settings for netsh on each level with the '/?'.

Example:

c:\Scripts>netsh /?

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\Use
rName] [-p Password | *]
             [Command | -f ScriptFile]

The following commands are available:

Commands in this context:
?              - Displays a list of commands.
add            - Adds a configuration entry to a list of entries.
advfirewall    - Changes to the `netsh advfirewall' context.
branchcache    - Changes to the `netsh branchcache' context.
bridge         - Changes to the `netsh bridge' context.
delete         - Deletes a configuration entry from a list of entries.
dhcpclient     - Changes to the `netsh dhcpclient' context.
dump           - Displays a configuration script.
exec           - Runs a script file.
firewall       - Changes to the `netsh firewall' context.
help           - Displays a list of commands.
http           - Changes to the `netsh http' context.
interface      - Changes to the `netsh interface' context.
ipsec          - Changes to the `netsh ipsec' context.
lan            - Changes to the `netsh lan' context.
nap            - Changes to the `netsh nap' context.
netio          - Changes to the `netsh netio' context.
p2p            - Changes to the `netsh p2p' context.
ras            - Changes to the `netsh ras' context.
rpc            - Changes to the `netsh rpc' context.
set            - Updates configuration settings.
show           - Displays information.
wcn            - Changes to the `netsh wcn' context.
winhttp        - Changes to the `netsh winhttp' context.
wins           - Changes to the `netsh wins' context.
winsock        - Changes to the `netsh winsock' context.
wlan           - Changes to the `netsh wlan' context.

The following sub-contexts are available:
 advfirewall branchcache bridge dhcpclient firewall http interface ipsec lan nap
 netio p2p ras rpc wcn winhttp wins winsock wlan


Thursday, June 10, 2010 7:04 PM

I realize that this is an old thread but I am hoping that someone may read this and have the answer to my question.

I am able to disable NetBios over TCIP by changing the following registry key...

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters\Interfaces, find the GUID(s) with NetbiosOptions set to 0 and set them to 2.

My question is how do I test that this worked?

Does it take effect the moment I make the chage to the registry? Or does the adapter need to be reset? And again, how do I know if I successfully disabled it.

Thanks for any help!

Doug


Friday, July 16, 2010 8:26 AM

Doug,

 

The adapter does need to be reset for the changes to take affect.

You can test whether it has worked by trying to view other machines in the Network Map, or I *think* trying to connect via \%servername%. If you aare unable to see the other boxes or cannot connect using \ then NetBios has been disabled.

 

Steve


Saturday, August 14, 2010 12:27 PM

Exactly what I was looking for! Thanks Steve.


Sunday, October 24, 2010 10:54 AM

Hi!

I hope this thread is still active.

I have done the following steps to disable NetBios over TCP/IP.

In services.msc, look for TCP/IP NetBIOS Helper double click on it disable it from the drop down menu.(u can also first click on stop then it will stop the service)

also right click on the computer at the start menu then choose the option manage,go to Devices and at the top of the screen look for VIEW check the option " view hidden devices" ,then look for Non plug & play devices ,double click on the NETBT option set it to disable!
looks like this:

Right click on Computer>Manage>devices> look the options above click on VIEW menu and check the option" view hidden devices" >non plug & Play devices>NETBT=Disable

or u could also via windows registry Unbind netbios device like this :

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\

Next look for the Value Name: TransportBindName and rename it to something else example; TransportBindName11

Close out of the registry Editor and reboot the system.

and also double click on it then remove the value \device\

Now, if I disable NetBios over TCP/IP in Hidden Devices using the following step, my PC no longer connect to the internet. :(

Right click on Computer>Manage>devices> look the options above click on VIEW menu and check the option" view hidden devices" >non plug & Play devices>NETBT=Disable

Every other steps, I could do and still have internet connection.

Is it because of virus or trojan?

Many thanks for advice.


Wednesday, January 18, 2012 4:32 PM

You can edit the registry to change the NetBIOS configuration. Under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters\Interfaces, find the GUID(s) with NetbiosOptions set to 0 and set them to 2. This is the equivalent of selecting disabled in the GUI.

With Server Core you can use regedit and connect remotely to set this or use the reg.exe command line tool.

Andrew

And here is the VBS script to run.

You will need admin rights, or put in a GPO under Computer Configuration/Policies/Windows Settings/Scripts/Startup:

OPTION EXPLICIT

Const HKEY_LOCAL_MACHINE    = &H80000002
Const sNetKey = "System\CurrentControlSet\Services\NetBT\Parameters\Interfaces\

Dim oReg            ' Registry object
Dim sSubKey         ' SubKey instance
Dim aSubKeys        ' SubKeys array
Dim dwValue         ' registry value

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\.\root\default:StdRegProv")
oReg.EnumKey HKEY_LOCAL_MACHINE, sNetKey, aSubKeys

' Top layer is interfaces
For Each sSubKey in aSubKeys
    oReg.GetDWORDValue HKEY_LOCAL_MACHINE, sNetKey & sSubKey, "NetbiosOptions", dwValue
    If dwvalue <> 2 Then
        oReg.SetDWORDValue HKEY_LOCAL_MACHINE, sNetKey & sSubKey, "NetbiosOptions", 2
    End If
Next

Consume. Conform. Obey.


Monday, March 26, 2012 4:09 AM

Hi Andrew,

does this required a server reboot?

thanks

unni


Wednesday, March 28, 2012 5:11 PM | 1 vote

Yes it does require a reboot.

Additionally here is just another way to use the wmic command discussed earlier in the thread

wmic nicconfig where (TcpipNetbiosOptions!=Null and TcpipNetbiosOptions!=2) call SetTcpipNetbios 2


Wednesday, January 21, 2015 8:18 PM

I know this is really old, but you can do it with a batch file too.

:: Enbale NetBios over TCP/IP on adapters
MD c:\temp
del c:\temp\interfaces*.txt
::Get list of interface GUIDs
reg export HKLM\System\CurrentControlSet\services\NetBT\Parameters\Interfaces c:\temp\interfaces.txt /y
:: Find just the key strings
type c:\temp\interfaces.txt |find /i "Tcpip" >c:\temp\interfaces2.txt
:: Remove the left and right brackets from the string
For /F "tokens=1 delims=[" %%i IN (c:\temp\interfaces2.txt) do echo %%i>> c:\temp\interfaces3.txt
For /F "tokens=1 delims=]" %%i IN (c:\temp\interfaces3.txt) do echo %%i>> c:\temp\interfaces4.txt
:: Change values on all interfaces
FOR /F %%k in (c:\temp\interfaces4.txt) do REG ADD %%k /t REG_DWORD /v NetbiosOptions /d 2 /f
del c:\temp\interfaces*.txt