List DEP computers by API

geoffreykobrien
Contributor

Does anyone know how to list machines that show in the DEP screen in the JSS from an API call? Im not seeing an option, but wanted to double check.

4 REPLIES 4

bofh
New Contributor III

Try adding a "Saved Search" and pull that one via API.

tryckman
New Contributor II

Were you ever able to solve this? We would like to do the same thing.

bofh
New Contributor III

Define a "Saved-Search" having the Criteria "Enrollment Method: PreStage enrollment" is "Your_Enrollment_name"

Query by it's id
URL: https://your.jss.url:8443/JSSResource/advancedcomputersearches/id/24

get the following output (stripped out a bit)

{
  "advanced_computer_search": {
    "id": 24,
    "name": "DEP-Search",
    "criteria": [
      {
        "name": "Enrollment Method: PreStage enrollment",
        "priority": 0,
        "and_or": "and",
        "search_type": "is",
        "value": "Your_Enrollment_name"
      }
    ],
    "display_fields": [
      {
        "name": "JAMF Binary Version"
      },
      {
        "name": "Last Check-in"
      },
      {
        "name": "Operating System"
      }
    ],
    "computers": [
      {
        "id": 257,
        "JAMF_Binary_Version": "9.97.1482356336",
        "Operating_System": "Mac OS X 10.12.3"
      },
      {
        "id": 258,
        "JAMF_Binary_Version": "9.97.1482356336",
        "Operating_System": "Mac OS X 10.12.3"
      },
      {
        "id": 293,
        "JAMF_Binary_Version": "9.97.1482356336",
        "Operating_System": "Mac OS X 10.12.3"
      },
      {
        "id": 295,
        "JAMF_Binary_Version": "9.97.1482356336",
        "Operating_System": "Mac OS X 10.12.3"
      }
    ]
  }
}

Of course you'd get them by the Name then :) just removed those parts for privacy reasons

Tirillo
New Contributor II

Hi,
unfortunately checking the computer API is not helping too much the devices show up in the Pre-enrollment section even before they have a computer name assigned.
As we have an external CMDB we would like to allow registration of macs only if the serial is already assigned to JAMF DEP.
This would avoid people to register their own mac in our CMDB.

I think that currently such an API is still not available in JAMF.