commandline to read the Room info?

chadsh3
New Contributor

Hi, is there a CLI from MacOS client to fetch the Room info under Inventory/User and Location/Room?

3 REPLIES 3

jcarr
Release Candidate Programs Tester

This can be read via the Jamf Pro API from the device inventory record.

pete_c
Contributor III

If you didn't want to use the API, you could use a given group membership to run a policy writing the value out to a temp file on each device, then read it as needed.

McAwesome
Valued Contributor

You can also store this information on the machine directly via a configuration profile.  The upside is you can just read from that, which gets around any need for API credentials.  The downside is that config would not update dynamically.  You'd have to set up a scoping that makes sure it gets removed should the building/room info need to change.

Here's the link to the page in Jamf's documentation that covers configuration profile payload variables

https://docs.jamf.com/10.42.0/jamf-pro/documentation/Computer_Configuration_Profiles.html#ID-00022bc...