Search API for Asset Tag

brytox
New Contributor III

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 1

thoule
Valued Contributor II

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!