Apple Studio Display

retroroscoe
Contributor

Hi All,

We have just purchased 3 Mac Studios with Apple Studio Displays.

The problem is I would like to record the serial/asset numbers of the displays to the Mac Studio they are connected to.

Anyone got any ideas around this?

1 ACCEPTED SOLUTION

PhillyPhoto
Valued Contributor

I wrote an EA for the firmware and saw this post, and figured why not one for the serial number too? This should work:

#!/bin/bash
result="<result>NOT Found</result>"
if [[ $(system_profiler SPDisplaysDataType | grep -i "Studio Display") != "" ]]
then
    dispSN1=$(system_profiler SPDisplaysDataType | grep -i "Display Serial Number:")
    dispSN2=${dispSN1#*: }
    dispSN3=${dispSN2%\n*}
    result="<result>$dispSN3</result>"
fi
echo "$result"

View solution in original post

6 REPLIES 6

DTB_Kirky
New Contributor III

You can create a Computer Management, Extension Attribute, set it to :

Data Type: String

Input Type: Text Field

 

You can then edit this field within the computers inventory page and set it to the serial number

jcarr
Release Candidate Programs Tester

Is the display serial number shown in a System Profiler report?  If so, you could code a EA to parse out the serial and return it using this command:

/usr/sbin/system_profiler

 

AJPinto
Honored Contributor III

If you are wanting to record the SN's grabbing them from the Mac is possible as others have suggested. However, recording SN's for fixed assets is more of an accounting problem. When the Displays were purchased there should have been a PO, that PO should have the SN's on it. If your org is letting people buy stuff outside of ecommerce, then getting the data from the Mac is your only option to not involve the users.

PhillyPhoto
Valued Contributor

I wrote an EA for the firmware and saw this post, and figured why not one for the serial number too? This should work:

#!/bin/bash
result="<result>NOT Found</result>"
if [[ $(system_profiler SPDisplaysDataType | grep -i "Studio Display") != "" ]]
then
    dispSN1=$(system_profiler SPDisplaysDataType | grep -i "Display Serial Number:")
    dispSN2=${dispSN1#*: }
    dispSN3=${dispSN2%\n*}
    result="<result>$dispSN3</result>"
fi
echo "$result"

This is perfect, worked like a charm. Thank you so much!

retroroscoe
Contributor

Thank you PhillyPhoto, that worked perfectly