Hello,
I am currently implementing an IT Asset Management Systems and would like to obtain the serial number, Model and manufacturer in an extension attribute.
I have run into some walls with some of the scripts I have tried. I have obtained about 50% of the displays with the attached script but am running into issues with other variations of monitors and in particular, docking stations; neither appear.
!/bin/sh
serial=system_profiler SPDisplaysDataType | grep -i "Display Serial Number" | sed -e 's/^[ ]*//' | cut -d " " -f 4
if [ "$serial" != "" ]; then
echo "<result>$serial</result>"
else
echo "<result>Display Not Found</result>"
fi
exit 0