Disable NetBIOS over TCPIP with vbscript
Part of building new servers I have been creating a script to configure add and remove features added to the Windows 2008 R2 servers. The process is being handled by powershell, command scripts and vbscripts.
Ran into a step to disable the WINS setting for Disable NetBIOS over TCP/IP. As with any step in the build process automation is the key to consistent builds and reduce human error. For this part I turned to vbscript and used the following script to execute the step on all the NIC’s defined on the system.
This script will work on Windows 2003 / 2008 servers.
‘ Disable NetBIOS over TCPIP
‘ Author: Mark Harris
‘ disablenetbios.vbs
‘ run as cscript /nologo disablenetbios.vbs
strComputer = “.”
‘ set to HKEY_LOCAL_MACHINE registry Hive
HKLM = 2147483650
‘ Set keyword value to open
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
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)
next
Leave a Reply