Enable Netbios over TCP (VBScript)

This code can be found in Chapter 3 of Windows Server 2003 Security Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' This code enables/disables the Netbios over TCP/IP setting.
' ------ SCRIPT CONFIGURATION ------
Const SET_NETBIOS = 2  ' 0 = Use setting from DHCP; 1 = Enable; 2 = Disable
strComputer = "."
' ------ END CONFIGURATION ---------

set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colNicConfigs = objWMIService.ExecQuery _
   ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

For Each objNicConfig in colNicConfigs
   intNetBIOS = objNicConfig.SetTCPIPNetBIOS(SET_NETBIOS)
   WScript.Echo objNicConfig.Description & _
                ": successfully set NetBIOS over TCP/IP to " & SET_NETBIOS
Next

This code has been viewed 2305 times.

New from the creators of TechTasks.com: StatSheet.com