Life of a techno-guru
Tuesday, October 10, 2006
  Disabling NetBIOS over TCP/IP Via Registry
So, if anyone out there is trying to get rid of NetBIOS to reduce broadcast traffic and optimize their network, I'm putting together a short guide on how to disable NetBIOS via the registry, should you need to perform this operation on a large number of computers. Since manually visiting each computer requires too much work, we'll look at the registry value we need to change using a script to disable NetBIOS.

The registry value we need to change resides in the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcpip_\ key, and the value's name is NetBIOSOptions. There are three valid values for this value:

0x0: Use NetBIOS setting from DHCP server or Enable if static IP is used
0x1: Enable NetBIOS over TCP/IP
0x2: Disable NetBIOS over TCP/IP

As you can probably tell, we want to use the last option, 0x2 as the correct value to disable NetBIOS. Let's look at how we can use WMI to access the registry of a computer remotely and change this value for us.

strComputer = "."
HKLM = 2147483650
valuename = "NetBIOSOptions"
subkey = "System\CurrentControlSet\Services\NetBT\Parameters\Interfaces\"

'Get registry provider from WMI
set registry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
'Get subkeys of Interfaces key ... these will be random GUIDs, so we need to grab them dynamically
registry.EnumKey HKLM, subkey, subkeys

for i = 0 to ubound(subkeys)
'Set hex value of registry value to 0x2. We have to use the built-in VBscript hex function to convert from decimal to hex data type
registry.SetDWORDValue HKLM, subkey & subkeys(i), valuename, hex(2)
god bless you

Did you ever get to the guide for pulling in a computer list for this? Also to include disable LMHosts check box?

Post a Comment

<< Home
My life of learning various things about technology including network administration, development, and 3D design

Location: Chicago, Illinois, United States
January 2006 / February 2006 / March 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / August 2007 / December 2007 / January 2008 / March 2008 / April 2008 / June 2008 / July 2008 / September 2008 / December 2008 / January 2009 / February 2009 / March 2009 / May 2009 /

Powered by Blogger