Spam Blank Push is a script to quickly send a blank push command to an advanced mobile device search on Jamf Pro Server.
To use spamblankpush, you will need Python3 and pipenv installed.
To install Python3 on macOS, download the pkg from https://www.python.org/downloads/. Once you've run and installed the pkg, find "Python 3.x" in your Applications directory and run the Update Shell Profile.command file, then the Install Certificates.command file.
To install Python3 on Windows, download its installer from https://www.python.org/downloads/. While installing, check the option to add Python to your PATH. Once the installation completes, reboot your computer so Python can be run from a command prompt.
Pipenv is used to install the dependencies for spamblankpush and keep them separate from any other Python projects on your computer. To install pipenv, run the following command in a terminal or command prompt:
pip3 install --user pipenv
You can download the script and its example configuration by selecting "Download ZIP" under the Clone or Download menu, clicking this link, or cloning it with git.
Use pipenv to create the virtual environment that will be used to run the script:
pipenv install --three
spamblankpush is configured via environment variables.
To set the configuration environment variables under most shells, type export VARIABLE_NAME=value. For example, to provide JAMF_USERNAME to the script from the environment, type:
export JAMF_USERNAME='spamblankpush'
Under a Windows shell, replace export with set.
The required configuration variables follow.
The base URL of your JPS server, with protocol and port. For example:
https://jps.example.com:8443
Username and password of a JPS user account with the following permissions:
- Jamf Pro Server Objects
- Advanced Mobile Device Searches: Read
- Mobile Devices: Create, Read
- Jamf Pro Server Actions
- Send Blank Pushes to Mobile Devices
The ID of the advanced mobile device search that you would like to send a blank push to. For example, the ID in this URL is '11':
https://jps.example.com:8443/advancedMobileDeviceSearches.html?id=11&o=r
You can find this URL by browsing to the advanced mobile device search in JPS.
Change into the script's directory. With the current shell configured as specified and its dependencies installed, it can be run with:
pipenv run python ./spamblankpush.py