Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.


macrumors member
Original poster
May 19, 2008
I am looking for a way to have a Mac that is bound to Active Directory report it's serial number and have it populate the description field in AD. Has anyone successfully made this work? Thanks


macrumors 68040
Feb 25, 2012
Sydney, Australia
A bash script could be written to get the serial number, join the machine to the domain, and then update the required attribute.


1. Get the serial#
system_profiler SPHardwareDataType | grep "Serial Number" | rev | cut -d " " -f1 | rev

2. Join to the domain

3. Update attribute

Obviously if the hosts are already joined to the domain skip step (2).
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.