Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jamf Pro Site Assignment Checker

Automated GitHub Actions workflow that checks Jamf Pro computers for missing site assignments and sends notifications to Slack, Microsoft Teams, and/or Email.

Features

  • Fetches all computers from Jamf Pro using v3 API
  • Retrieves hardware serial numbers from inventory
  • Identifies computers without site assignments
  • Sorts results by managed status (managed first, then unmanaged)
  • Sends notifications to multiple platforms:
    • Slack (with Block Kit formatting)
    • Microsoft Teams (with markdown tables)
    • Email (with HTML formatting)
  • Automatic token management and refresh
  • Runs on schedule or manually
  • Uses OAuth2 for secure Jamf Pro authentication

Setup Instructions

1. Create Jamf Pro API Credentials

  1. Log in to Jamf Pro
  2. Go to SettingsSystemAPI Roles and Clients
  3. Click New under API Clients
  4. Configure the client:
    • Display Name: GitHub Site Checker
    • Enabled: Checked
    • Privileges: Add the following permissions:
      • Jamf Pro Server Objects → ComputersRead
      • Jamf Pro Server Objects → Computer Inventory CollectionRead
  5. Click Save
  6. Important: Copy the Client ID and Client Secret immediately (you won't see the secret again!)

2. Set Up Notification Webhooks (Choose One or More)

Option A: Slack (Recommended)

  1. Go to https://api.slack.com/apps
  2. Click Create New AppFrom scratch
  3. Name it "Jamf Site Checker" and select your workspace
  4. Click Incoming Webhooks in the left sidebar
  5. Toggle Activate Incoming Webhooks to On
  6. Click Add New Webhook to Workspace
  7. Select the channel where you want notifications
  8. Copy the webhook URL (starts with https://hooks.slack.com/services/...)

Option B: Microsoft Teams

  1. In Teams, go to the channel where you want notifications
  2. Click ••• (More options) → Connectors (or Workflows in newer Teams)
  3. Search for Incoming Webhook
  4. Click Add or Configure
  5. Give it a name like "Jamf Site Alerts"
  6. Upload an icon (optional)
  7. Click Create
  8. Copy the webhook URL

Option C: Email (Gmail Example)

  1. Enable 2-factor authentication on your Google account
  2. Go to https://myaccount.google.com/apppasswords
  3. Create an app password for "Mail"
  4. Note the 16-character password
  5. You'll use these settings:
    • SMTP Server: smtp.gmail.com
    • SMTP Port: 587
    • SMTP Username: Your Gmail address
    • SMTP Password: The app password you created

3. Configure GitHub Secrets

Go to your repository → SettingsSecrets and variablesActions

Click New repository secret and add the following:

Required Secrets (Jamf Pro)

Secret Name Example Value Description
JAMF_URL https://yourcompany.jamfcloud.com Your Jamf Pro URL (no trailing slash)
JAMF_CLIENT_ID abc123def456... API Client ID from Jamf Pro
JAMF_CLIENT_SECRET xyz789... API Client Secret from Jamf Pro

Optional: Slack Notifications

Secret Name Example Value Description
SLACK_WEBHOOK_URL https://hooks.slack.com/services/T00/B00/XXX Slack incoming webhook URL

Optional: Teams Notifications

Secret Name Example Value Description
TEAMS_WEBHOOK_URL https://outlook.office.com/webhook/... Teams incoming webhook URL

Optional: Email Notifications

Secret Name Example Value Description
NOTIFICATION_EMAIL admin@company.com Recipient email address
SMTP_SERVER smtp.gmail.com SMTP server address
SMTP_PORT 587 SMTP port (usually 587 for TLS)
SMTP_USERNAME notifications@company.com SMTP authentication username
SMTP_PASSWORD your-app-password SMTP authentication password
SENDER_EMAIL jamf-alerts@company.com From email address (optional)

Note: You can configure one, two, or all three notification methods. The script will automatically detect which webhooks are configured and send to all available platforms.

4. Run the Workflow

Automatic (Scheduled)

The workflow runs automatically:

  • 9 AM CST (3 PM UTC) - Monday through Friday
  • 3 PM CST (9 PM UTC) - Monday through Friday

Manual Trigger

  1. Go to your repository on GitHub
  2. Click the Actions tab
  3. Select Check Jamf Computers for Missing Sites
  4. Click Run workflow (dropdown on the right)
  5. Select branch: main
  6. Click Run workflow (button)

Customization

Change Schedule

Edit .github/workflows/check-jamf-sites.yml:

on:
  schedule:
    # 9 AM CST = 3 PM UTC (Monday-Friday)
    - cron: '0 15 * * 1-5'
    # 3 PM CST = 9 PM UTC (Monday-Friday)
    - cron: '0 21 * * 1-5'
  workflow_dispatch:

About

Automated GitHub Actions workflow that checks Jamf Pro computers for missing site assignments and sends notifications to Slack, Microsoft Teams, and/or Email.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages