Disable NetBIOS over TCP/IP with PowerShell

Simple script to disable NetBIOS over TCP/IP with PowerShell:

 

$key = Get-ChildItem HKLM:\System\CurrentControlSet\Services\NetBT\Parameters\Interfaces

ForEach($nic in $key)
{
if (!(Get-ItemProperty $nic.pspath).NetbiosOptions -eq 2)
{
Set-ItemProperty $nic.pspath -name "NetbiosOptions" -value 2
Write-Host "Successfully set $nic\NetbiosOptions to 2"
}
Else
{
Write-Host "$nic\NetbiosOptions already set to 2"
}
}

Leave a comment

Your email address will not be published. Required fields are marked *

9 − seven =