Posted on 09-01-2014 01:03 AM
Hello everyone,
My company has 300 macs and I need to configure the search domains on each one by using a script. I found this one which works perfectly : networksetup -setsearchdomains Ethernet domain1 domain 2 domain 3.
But i had 2 little problems. First, how can I use this script on new macbook air who got a different name (interface) for the Ethernet ? Second, I wasn't able to install the script by using Casper Imaging ( even when I choose to install it After or At Reboot). But when I apply a policy on the Mac after imaging it , it works perfectly.
Thank you all in advance for your answers.
Merieme
Posted on 09-01-2014 10:24 AM
I believe the Macbook Air shows "Thunderbolt Ethernet" when the thunderbolt to ether adapter is plugged in. To test this, I check to see if the adapter is plugged in:
ThunderboltEth=`networksetup -listallhardwareports | grep "Thunderbolt Ethernet"`
if so, then I just use
networksetup -setsearchdomains "Thunderbolt Ethernet" domain1 domain 2 domain 3
Posted on 09-01-2014 12:12 PM
Hi,
I wrote a script to combat this exact issue. Supply it with the adapter name (e.g. Ethernet) and it will find all "ethernet" devices and program them up with both DNS and Search Domain fields.