Extension Attribute for Displays/Monitors

Not applicable

Hi Casper list, I was wondering if anybody is currently using an extension attribute to retrieve Display/Monitor info from your JSS clients. Basically I will like to get Model Name/Screen size based on the extension attribute. I'm trying to find the best approach for this task, any ideas/comments?

Thanks Guys!!

![external image link](attachments/88622eaf5b5a405f84cc108c44f2b961)

8 REPLIES 8

stevewood
Honored Contributor II
Honored Contributor II

There might be an easier way to do this, but you might look at using
On Tue, Oct 11, 2011 at 1:59 PM, Richard Barbetti <richard.barbetti at macys.com> wrote:
system_profiler and some combination of grep and awk to pull what you need. Just playing around quickly I came up with this to pull the displays:

system_profiler | grep -i -B 1 resolution:

Of course, this pulls back a bit more info than you need, but it is a
starting point.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475

sean
Valued Contributor

system_profiler can take ages to run depending on the machine/environment

I'd always suggest pulling the section of the profile that you want

system_profiler SPDisplaysDataType | grep -i -B 1 resolution

Walter
New Contributor II

$ system_profiler SPDisplaysDataType | grep -B 1 Resolution | xargs echo -n | sed -e 's/: Resolution://'
LED Cinema Display 1920 x 1200

--
Walter Rowe, System Hosting
Enterprise Systems / OISM
walter.rowe at nist.gov<mailto:walter.rowe at nist.gov>
301-975-2885

Not applicable

Thanks to all of you for your suggestions,

sean
Valued Contributor

You are assuming only one monitor!

sed -e 's/: Resolution://g'

Would be wiser. At which point you might want to put the newlines back in!!!

sed 's/-- /'$' ''/'

Sean

sean
Valued Contributor

Oops, same problem, that should have read

sed 's/-- /'$' ''/g'

S

:)

Not applicable

Having just written a script to do a similar job, the main thing I found once finished was that querying SPDisplaysDataType while the machine is at LoginWindow returns nothing!
Just a heads up on that ;-)

I found ScreenUtil met my needs better: http://www.mowlem-enterprises.co.uk/

Cheers,
Hamish
--
Hamish Ward
Mac Software Image Development
Information Technology Services
Massey University
Private Bag 11-222
Palmerston North
Phone (06) 356-9099 extn 81143 021 1847 863

sean
Valued Contributor

It's true, depends on how important this EA is.

For items of this nature, you could use launchd to compile a list of items that you want and place them into your own plist and ensure this only runs when someone is logged in.

Your EA then just needs to list the items from your plist.

Sean