How to change the Wins IP address on a computer with Powershell

Were you wondering if anyone has a Powershell script that can change the Wins
IP address on a server?

Get-WmiObject -ComputerName "." `
Win32_NetworkAdapterConfiguration | ?{$_.IPEnabled -eq
$True} | `

% {$_.SetWINSServer("172.16.1.240",
"172.16.1.241")}


I’m guessing you’ll want to do this on multiple servers.
One way you can do it is read a list of servers from a file into a variable and then run the command on each server:

 $servers = get-content c:servers.txt

foreach ($server in $servers) {

Get-WmiObject -ComputerName $server `

Win32_NetworkAdapterConfiguration | ?{$_.IPEnabled -eq
$True} | `

% {$_.SetWINSServer("172.16.1.240",
"172.16.1.241")} }
Advertisements

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