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

pcgolfer85

macrumors member
Original poster
May 19, 2008
69
0
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
 

SlCKB0Y

macrumors 68040
Feb 25, 2012
3,402
542
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.

Hints:

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

2. Join to the domain
https://developer.apple.com/library...win/Reference/ManPages/man8/dsconfigad.8.html

3. Update attribute
https://developer.apple.com/library...win/Reference/Manpages/man1/ldapmodify.1.html

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.