Rename and Bind Script
I wanted to update the MacRename script I build last year for renaming macs and add domain binding portion, so I made a Rename and Bind Script to add the functionality of joining the macs to the domain at the same time they are renamed, including moving them to the correct OU. The script works really well with ARD, specially if you need to quickly rename and bind to your domain a batch of macs.
A little recap…
At the “Mothership” we had a problem finding a useful conventional way to rename the Mac’s in our network. So I wrote a script that checks what type of computer chassis you have, if you have a laptop it ads the prefix ML- for Mac Laptop and if you have a Workstation (Mac Mini, iMac or Mac Pro) it adds MW- then after the model is chosen, and if you have a server (Xserve) it adds S-, it attaches the serial number of the mac to the name like this: ML-C1M23RM0236T6 – for a MacBook Pro or S-C025T3V3J085, for a server.
In order to make the users unable to change the name I attach it to the login and logout hooks, that way if I see a computer named differently I can reboot the Mac in question and it will be renamed accordingly. Like this:
The original script is here:
What is new…
During the beginning of 2015, after I implemented FileWave as our systems manager platform, I modified the script so I could rename the computer and add it to the domain in one swift move:
Note: This script is an update on the original one posted on Feb 6, 2014 on: http://www.enterpriseosx.com/mac-rename-script/