How to clear WINS from Network Adapter Configuration with Powershell

Hello Guys…!!!

Here is the simple script to clear the WINS entry from multiple servers with powershell script.

$servers=gc C:\ServerList.txt
foreach($server in $servers){
$adapters=Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName $server
foreach($adapter in $adapters){
Write-Host "=======Before Making the WINS NULL=========" -ForegroundColor White
Write-Host $adapter.Description,$adapter.WINSPrimaryServer,$adapter.WINSSecondaryServer
$adapter.SetWINSServer("","")
}
}
Advertisements

One thought on “How to clear WINS from Network Adapter Configuration with Powershell

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