Skip to content

Instantly share code, notes, and snippets.

View karpadiem's full-sized avatar

Jake Garrison karpadiem

View GitHub Profile
@karpadiem
karpadiem / mosyle_license_audit.py
Last active November 18, 2024 12:54
This script is used to audit Mosyle MDM's user and devices license. It queries their API for devices and calculates the amount of licenses an account should be charged for. Using this we found that we were being billed for an extra User Enrollment license for a device and user that no longer showed in our dashboard.
# Author: Jake Garrison
# Date: 2023-03-29
# Description: This script fetches devices from the Mosyle API and processes it to help us in creating our managment fee reports. It can also be used to audit Mosyle licenses to compaire with current billing.
# This script requires the Mosyle API token, Mosyle API URL, Mosyle API User, and Mosyle API Password to be set. It also requires the tabulate module to be installed. You can install it with pip install tabulate (or pip3 install tabulate)
# THis is a simplified version of our script primarly aimed at helping other companies perform a license audit.
import base64
import requests
import json
from sys import exit