Changing NetBIOS over TCP/IP with Powershell

I needed to re-enable netBIOS over TCP/IP on a set of computers after someone disabled it and broke a system. Powershell was obviously the easiest way to do it!

Here is the code:

$servers = "myserver01", "myserver02", "myserver03", "myserver04", "myserver05", "myserver06"
Foreach ($server in $servers){
  $adapter=(gwmi -computer $server win32_networkadapterconfiguration | where {$_.servicename -like "vmxnet*"})
  $adapter.settcpipnetbios(1)
}

A value of 1 for settcpipnetbios enables it, and 2 disables it. 0 is to use the DHCP default (from memory).

Advertisements

1 Comment

Filed under Microsoft, Powershell, Windows 2008

One response to “Changing NetBIOS over TCP/IP with Powershell

  1. Pingback: DNS Name Lookup Failure when using Remote Desktop Connection Manager « A Resting Sys Admin's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s