Binding Macs to Active Directory - Description Information

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,126
197
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/mac/documentation/Darwin/Reference/ManPages/man8/dsconfigad.8.html

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

Obviously if the hosts are already joined to the domain skip step (2).
 
Last edited: