Skip to content

Instantly share code, notes, and snippets.

View vbnin's full-sized avatar

Vincent vbnin

  • Jamf
  • Paris
View GitHub Profile
@vbnin
vbnin / delete_offline_protect_computers.sh
Created May 27, 2025 10:40
Delete offline Mac endpoints from Jamf Protect
#!/bin/bash
# This example Bash script below does the following:
# - Obtains an access token.
# - Completes a listComputers query request that returns a list of computers offline since a date defined in input parameters
# - Asks for confirmation
# - Delete offline computers
# Keep the following in mind when using this script:
# - You must define the PROTECT_INSTANCE_PREFIX, CLIENT_ID, and PASSWORD variables to match your Jamf Protect environment. The PROTECT_INSTANCE_PREFIX variable is your tenant name (e.g., your-tenant), which is included in your tenant URL (e.g., https://your-tenant.protect.jamfcloud.com).
@vbnin
vbnin / websites.json
Last active December 4, 2024 08:56
A JSON file listing several websites used to simulate network traffic on demo devices
{
"websites": [
"https://salesforce.com",
"https://github.com",
"https://monday.com",
"https://okta.com",
"https://zoom.us",
"https://slack.com",
"https://trello.com",
"https://asana.com",
@vbnin
vbnin / list_jamf_protect_computers.sh
Created November 14, 2024 20:19
Simple SZH script showing how to list computers in the Jamf Protect macOS Security Portal using GraphQL
#!/bin/zsh
# This script will generate a bearer token for Jamf Protect and list computers in the macOS Security Portal
# Jamf Protect variables
PROTECT_URL='https://YOUR_INSTANCE.protect.jamfcloud.com'
CLIENT_ID=''
CLIENT_SECRET=''
# Generate Bearer Token
@vbnin
vbnin / list_jamf_pro_departments.py
Created November 14, 2024 20:01
Simple Python script showing how to list departments in Jamf Pro using Jamf Pro API and an API client.
### This script will generate a bearer token to Jamf Pro and then list all departments in the Jamf Pro tenant
import requests
url = "https://YOUR_INSTANCE.jamfcloud.com"
client_id = ""
client_secret = ""
# Headers
headers = {
@vbnin
vbnin / create_jamf_pro_department.sh
Created November 14, 2024 19:54
Simple ZSH script showing how to list Jamf Pro departments and create a new department using Jamf Pro API and an API client.
#!/bin/zsh
# This script will do the following:
# - Generate a bearer token for Jamf Pro
# - List all Jamf Pro departments in the instance
# - Create a new department
# Get Jamf Pro variables
URL="https://YOUR_INSTANCE.jamfcloud.com"
API_CLIENT=""
@vbnin
vbnin / main.tf
Created November 14, 2024 19:42
Configure Jamf Pro using Terraform - Basic Example
# This terraform config file is a basic example of how to create a category, department and building in Jamf Pro
terraform {
required_providers {
jamfpro = {
source = "deploymenttheory/jamfpro"
version = "0.4.3"
}
}
}