Posted on 02-28-2018 05:51 PM
Does anyone have a good method of adding WINS servers to Ethernet, Wi-Fi, and Ethernet Adapters?
Like in the picture below?
I need to add two WINS Servers to our Macs via bash script if possible.
I think I've identified the .plist that this is stored at (/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist), but I'm not having any lucky modifying it.
If the best way to do it is the add it to this plist, I guess I need to insert two values in the WINSServerAddressList key/array:
Posted on 02-28-2018 06:10 PM
If you just need to modify that value then a simple:
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server WINSServerAddressList "192.168.229.2"
Untested as I don't use WINS but that is the command. Might try without the quotes. Good luck.
Posted on 03-01-2018 09:14 AM
Hello @Snickasaurus .
I need to add two WINS servers to that array.
Do you know the command for that?
Thanks!
Posted on 03-01-2018 09:41 AM
@jwm3wn Looking at it and I can't seem to find a way to add two addresses. Give me a little more time and I'll see what I can find.
Posted on 03-01-2018 10:15 AM
I was thinking one would have to use PlistBuddy but I believe it can be done with just the defaults command. This is a snippet from a script I used in the past.
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist WINSServerAddressList -array-add '
<string>192.168.1.11</string>
<string>192.168.1.12</string>'
I'm not at my Mac to test it but I did find this page with some searching. Perhaps it can get you headed in the correct direction. I'll be home a little later today and can test a few things out.
Posted on 03-01-2018 02:29 PM
@Snickasaurus , it doesn't look like that command works. I can add one WINS server at a time, so that works. The problem is that it does not update the WINS server in the GUI.
Is there not an scutil command or something else that uses a unix executable that does it?
Posted on 03-04-2018 01:56 PM
I haven't been able to get this to work with more than one address. I'll keep trying. Meanwhile, I hope to give this a bump so someone else might give their take on it.
Posted on 03-13-2018 09:45 PM
@jwm3wn Check out the script at the top of this post. Format your 'defaults write' command like he did with the '--add-array -string' portion and see if that adds both WINS IP Addy's.
Posted on 12-05-2018 10:38 AM
I was trying to do this exact thing and finally got it to work adding two with the following syntax
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server WINSServerAddressList -array "XXX.XXX.XXX.XXX" "XXX.XXX.XXX.XXX"