# Is there a way to run on a list of computers and enable NetBios on them?

I'm looking for a way to enable NetBios on all servers in my domain for a limited time of about a month and later i am supposed to disable it again (it is used by some inventory application we are using). Do you have any idea how to achieve this goal? Powershell script would be nice.

-

The following script will do what you want via PowerShell. You will need a text file with the name of each server on a line. The script assumes that there is one active NIC on each system. If you have multiple active NICs, you would need to loop through them, setting on each.

$computers = Get-Content -Path "S:\ome path\to text file.txt" foreach ($computer in $computers) {$NIC = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = true" -ComputerName $computer$NIC.SetTcpipNetbios("1")
}


If you have all of your servers in one OU, you could use the QuestAD cmdlets to pull all of them into the \$computers variable, then pass the name that way.

-

Use Wmic

Create a separate text file that contains a CSV list or a carriage-return-delimited list of computer names called somefile.txt

Then run the following commands from an appropriate permissioned account:

wmic /node:@somefile.txt /interactive:off nicconfig where TcpipNetbiosOptions=0 call SetTcpipNetbios 1
wmic /node:@somefile.txt /interactive:off nicconfig where TcpipNetbiosOptions=2 call SetTcpipNetbios 1


When you are done change the above code to SetTcpipNetbios to 2 (disabled). (0 is set via DHCP)

-