Share via


Is NetBIOS over TCP/IP Enabled?

As anyone who has typed 'ipconfig /all' knows, Windows has a lot of pesudo- and otherwise irrelevant network adapters that exist only as 'logcal entities'.  The clause 'where IPEnabled='true'" will separate out the true TCP/IP adapters, but in some cases even they are but building blocks, such as HP's Team adapter.  So, we can have a server with multiple adapters, and we want to know which one has NetBIOS over TCP/IP enabled, if any.

$wmi = Get-WmiObject -computerName $myComputer -query "select * from win32_networkadapterconfiguration where IPEnabled='true'";
$interface = $null;
$wmi | % { if ($_.TcpIpNetBiosOptions) { $interface = $_; break; }}
[bool]$interface;

Comments

  • Anonymous
    July 24, 2015
    This format is a bit cleaner. Function Get-Netbios { $EnabledNics= @(gwmi -query "select * from win32_networkadapterconfiguration where IPEnabled='true'") $OutputObj = @() foreach ($Network in $EnabledNics) { If($network.tcpipnetbiosoptions) { $netbiosEnabled = [bool]$network } $nic = gwmi win32_networkadapter | where {$.index -match $network.index} $OutputObj  += @{ Nic = $nic.netconnectionid NetBiosEnabled = $netbiosEnabled } #$OutputObj #| % { new-object PSObject -Property $} | ft -auto } $out = $OutputObj | % { new-object PSObject -Property $_} | select Nic, NetBiosEnabled| ft -auto $out }

  • Anonymous
    July 24, 2015
    The comment has been removed