[UniMacTech] Serial number in a shell script

Nigel Kersten nigel at explanatorygap.net
Mon Mar 10 09:38:48 EST 2008


On 2008 3 9, at 15:30, Tony Williams wrote:

>
> I've got a large bunch of laptops coming in (>50) and we have  
> decided to give them names derived from their serial number so I  
> need to discover the serial number inside a shell script os I can  
> name them and bind to AD. Any ideas or example code greatly  
> appreciated.
>
> (Apologies for cross posting to MacEnterprise and the Aussie  
> UniMacTech lists)


Getting the serial number:
system_profiler SPHardwareDataType | awk '$1=="Serial"{print $3}'

Setting the computername:
scutil --set ComputerName




More information about the unimactech mailing list