As part of a recent decommission / security audit, we needed to remove an old WINS server. For desktop client this is fairly easy as they are all assigned through DHCP so it was just a case of removing WINS from the DHCP scope options.
For the hundreds of servers it is set manually, which to remove one by one would take a long time and be pretty boring for the person tasked with it. So I decided the simplest option would be to use PowerShell.
First I wanted to check if servers had WINS enabled so I could reduce the amount of server I would need to run the disable script against.
I am going to use Get-WmiObject and the Win32_NetworkAdapterConfiguration class as this is the simplest way I found to do this in PowerShell.
We will use a text file with a list of server names and a variable called $WINSServer that will be used to filter only network interfaces that have WINS set.
Below is the script to check for WINS and output to PowerShell windows I am just getting all adapters that have WINSPriamryServer value set to the IP in the $WINSServer variable and then selecting the objects to be outputted.
If you wanted to export to a csv or text file just add a | after the WINSPrimaryServer at the end of the script and do either Out-file or Export-csv and the path to export too.
Below is the link to the script location on Github it called Check-Wins.ps1
Below is the link to the script location on Github it called Remove-Wins.ps1 :