Skip to main content
Question

Search API for Asset Tag

  • June 27, 2016
  • 1 reply
  • 2 views

Forum|alt.badge.img+4

Hi

I have been hunting around to find a better way to do this, but im coming up short. I want to be able to get a machines details using the asset tag, seems the only way to do it is loop over every machine in the jss.

Its not included in the basic subset, so thats no help.

Has anyone found a better way?

1 reply

Forum|alt.badge.img+15
  • Contributor
  • June 27, 2016

Create an advanced search and save it. Make sure it displays the asset tag.

curl -H "Accept: application/xml" -sfku "$username:$password" "$server/JSSResource/computerreports/name/$savedSearchName" -X GET | xmllint --format - > /private/tmp/SavedReport.xml

Then you can go through that and look for the asset tag. @mm2270 get credit as he showed me that trick a while ago!