Faust Romero
asked on
Disable NetBios Seeting via Group Policy
I have been trying to disable NetBIOS setting via Group Policy without luck. I have Windows 2012 R2 Domain Controllers, Windows server 2008 R2, windows 2008, and all windows client 8.1 and win 10. I have followed the following link to use scripts and to configure the Groups Policy under computer configuration->Policies->W indows settings->Scripts->Startup and attached the script as shown in the picture. Some windows are configured with manual IP address. All servers configure with manual IP address. The policy is applied on windows client OU, and Server OU.
In addition, I have also enabled on computer configuration ->Administrative templates->Systems->Script s "Run startup scripts asynchronously", "Run startup scripts synchronously", "Specify maximum wait time for Group Policy scripts" with 60 seconds.
In addition, I have disabled UAC on one windows machine. is there any else I am missing. I would like to do this through Group Policy and not manually on each server and computer.
Thanks a lot for suggestions.
In addition, I have also enabled on computer configuration ->Administrative templates->Systems->Script
In addition, I have disabled UAC on one windows machine. is there any else I am missing. I would like to do this through Group Policy and not manually on each server and computer.
Thanks a lot for suggestions.
Please post Bat file
ASKER
Batch File below.
' Title: Configure NetBIOS over TCP/IP
' Date: 2/25/2013
'Updated:
' Author: Gregory Strike
' URL: http://www.gregorystrike.com/2013/02/25/configure-netbios-over-tcpip-group-policy.html
'
'Purpose: The following script will itterate through all NICs on a computer
' to configuure NetBIOS over TCP/IP. It finds the NICs listed under:
' HKLM\SYSTEM\CurrentControl Set\servic es\NetBT\P arameters\ Interfaces
'
' For each NIC under the key, it sets the NetbiosOptions value to one
' of the below. (Be sure to uncomment the setting you desire.)
'
' 0 - Default: Use DHCP setting from the DHCP Server
' 1 - Enable NetBIOS over TCP/IP
' 2 - Disable NetBIOS over TCP/IP
'
'Requirements: Administrative Privileges
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set ObjWMI = GetObject("winmgmts:{imper sonationLe vel=impers onate}!\\" & strComputer & "\root\default:StdRegProv" )
'Set the path to the Network Interfaces
strKeyPath = "SYSTEM\CurrentControlSet\ services\N etBT\Param eters\Inte rfaces"
'Get all the known interfaces
ObjWMI.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
'If there was a problem getting strKeyPath, exit the script before throwing an error.
If IsNull(arrSubKeys) Then WScript.Quit
WScript.Echo Now() & " - Searching for Network Adapaters."
'Loop through all Network Interface Cards and disable NetBIOS over TCP/IP
For Each Adapter In arrSubKeys
WScript.Echo Now() & " - Disabling NetBIOS over TCP/IP on '" & Adapter & "'"
'Default: Use DHCP setting from the DHCP Server
'objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 0
'Enable NetBIOS over TCP/IP
'objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 1
'Disable NetBIOS over TCP/IP
objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 2
Next
WScript.Echo Now() & " - Completed."
' Title: Configure NetBIOS over TCP/IP
' Date: 2/25/2013
'Updated:
' Author: Gregory Strike
' URL: http://www.gregorystrike.com/2013/02/25/configure-netbios-over-tcpip-group-policy.html
'
'Purpose: The following script will itterate through all NICs on a computer
' to configuure NetBIOS over TCP/IP. It finds the NICs listed under:
' HKLM\SYSTEM\CurrentControl
'
' For each NIC under the key, it sets the NetbiosOptions value to one
' of the below. (Be sure to uncomment the setting you desire.)
'
' 0 - Default: Use DHCP setting from the DHCP Server
' 1 - Enable NetBIOS over TCP/IP
' 2 - Disable NetBIOS over TCP/IP
'
'Requirements: Administrative Privileges
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set ObjWMI = GetObject("winmgmts:{imper
'Set the path to the Network Interfaces
strKeyPath = "SYSTEM\CurrentControlSet\
'Get all the known interfaces
ObjWMI.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
'If there was a problem getting strKeyPath, exit the script before throwing an error.
If IsNull(arrSubKeys) Then WScript.Quit
WScript.Echo Now() & " - Searching for Network Adapaters."
'Loop through all Network Interface Cards and disable NetBIOS over TCP/IP
For Each Adapter In arrSubKeys
WScript.Echo Now() & " - Disabling NetBIOS over TCP/IP on '" & Adapter & "'"
'Default: Use DHCP setting from the DHCP Server
'objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 0
'Enable NetBIOS over TCP/IP
'objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 1
'Disable NetBIOS over TCP/IP
objWMI.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & Adapter, "NetbiosOptions", 2
Next
WScript.Echo Now() & " - Completed."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I Changed to PowerShell as attached. I also ran gpresult commands on one server, see attached. I omitted some information. as per the gpresult, the policy is being applied, however, I do not see that change in the NIC properties'. it stills shows in the default. what else could be wrong? I am supposed to see the change don the NIC properties to confirm it is being applied correct?
C--Users-fausto.romero-Desktop-gpres.txt
C--Users-fausto.romero-Desktop-gpres.txt
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it works via PowerShell with extension ps1 with script posted on computer policy. Thanks a lot.