Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
####################################################################################################
#
# Copyright (c) 2021, JAMF Software, LLC. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
import json
import requests
################# REQUIRED USER DEFINED VARIABLES ############
# set network ID from https://url.jamfcloud.com/devices/enroll.html -> On device enrollment -> Network ID
networkId='yournetworkid'
# set api key from https://url.jamfcloud.com/configuration/api
apiKey='yourapikey'
#!/usr/bin/env python3
import csv
import json
import requests
## CSV FORMAT:
# header row - ignored (but should exist)
# serial number
import json
import requests
################# REQUIRED USER DEFINED VARIABLES ############
# set network ID from https://url.jamfcloud.com/devices/enroll.html -> On device enrollment -> Network ID
networkId='networkidhere'
# set api key from https://url.jamfcloud.com/configuration/api
apiKey='apikeyhere'
@pirkla
pirkla / jnuc2021.py
Last active November 19, 2021 15:23
import json
import requests
# Set all users' passwords in a group to 1234
################# REQUIRED USER DEFINED VARIABLES ############
# set network ID from https://url.jamfcloud.com/devices/enroll.html -> On device enrollment -> Network ID
networkId='networkidhere'
# set api key from https://url.jamfcloud.com/configuration/api
#!/usr/bin/env python3
####################################################################################################
#
# Copyright (c) 2021, JAMF Software, LLC. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#!/usr/bin/env python3
####################################################################################################
#
# Copyright (c) 2021, JAMF Software, LLC. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
import csv
import json
import requests
networkId=''
apiKey=''
baseURL='https://url.jamfcloud.com/api'
import json
import requests
################# REQUIRED USER DEFINED VARIABLES ############
# set network ID from https://url.jamfcloud.com/devices/enroll.html -> On device enrollment -> Network ID
networkId='networkidhere'
# set api key from https://url.jamfcloud.com/configuration/api
apiKey='apikeyhere'
@pirkla
pirkla / CSVtoAPI.sh
Last active September 4, 2020 16:27
#!/bin/sh
# Set the url and credentials
jssURL="https://yoururl.jamfcloud.com"
jssUser="username"
jssPass="password"
csvPath="/path/to/some.csv"
endpoint="someendpoint"
IFS=', ' read -r -a allIDs < "$csvPath"