Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
server='jamf.jamfcloud.com'
port='443'
echo "[start] Script will export the certificate chain for ${server} running on port ${port}..."
echo
# echo "The certificate trust chain for this server is:"
# echo | openssl s_client -connect "${server}:${port}" 2>&1 | sed -ne '/Certificate chain/,/---/p' | sed '$d' | sed '1d'
# echo
#!/bin/bash
BaseURL='https://your.jamfcloud.com'
UserPass='api:apipass'
deviceID='1024'
command='ClearPasscode'
URL="${BaseURL}/JSSResource/mobiledevicecommands/command/${command}/id/${deviceID}"
echo "Sending \"${URL}\""
@macnotes
macnotes / jamfmobiledevicedataexport.sql
Created April 3, 2019 20:13
SQL script to export data from Jamf Pro MySQL
-- ==============================================================
-- SQL to export selected data for reporting.
-- Main interests at this point are MD denormalized, apps,
-- ==============================================================
-- A lot of the fields could be omitted. Just dump what you really need.
-- ==============================================================
-- Dates to be exported in this format...
SET @EUR=GET_FORMAT(DATETIME,'EUR');
@macnotes
macnotes / CreateThenDeleteJamfMobileDevice-2019-03-26.ps1
Created March 27, 2019 02:52
Example Script Demonstrating Jamf Pro Customer API Powershell (Create and then delete a Mobile Device)
# Use Jamf Customer API to create a Jamf Mobile Device record then delete it.
# v1 osl/jamf 2018-03-26
# Settings...
$ErrorActionPreference = "Stop"
$printDebugInfo = $true # $true or $false
# An extension attribute name into which we will save a dummy value.
# This must exist in the target JSS
$ExtensionAttributeName="CA_ActiveSync-ExchangeID"
@macnotes
macnotes / ldapsearch_tests.sh
Created March 14, 2019 15:26
Some bash command line LDAP examples
#!/bin/bash
#Some command line LDAP examples:
#used ldap utils in macOS 10.14.3
#ldap test bind to check user/pass
#Lookup user info
#Check if user exists
# [!] Be safe...
# You would never want to sent these commands without SSL. Otherwise, credentials go in cleartext.
# Likewise, never put credentials on command line or they'll show up in process history.
<?php
// This is triggered when an enrollment webhook is recieved.
// //////////////////////////////////////////////////////////////
// /////////// Start of user-defined runtime vars /////////////
// //////////////////////////////////////////////////////////////