Skip to content

Instantly share code, notes, and snippets.

@haircut
Created September 2, 2022 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haircut/2a409fffe55ba65aa353642e5697f38b to your computer and use it in GitHub Desktop.
Save haircut/2a409fffe55ba65aa353642e5697f38b to your computer and use it in GitHub Desktop.
A minimal reimplementation of my Python script that renames computers using a Google sheet as a data source.
#!/bin/zsh
# Replace with the ID of your Google Sheet
DOCUMENT_ID="XXX"
SHEET="https://docs.google.com/spreadsheets/d/${DOCUMENT_ID}/edit#gid=0/export?format=csv&id=${DOCUMENT_ID}&gid=0"
/usr/bin/curl -L "${SHEET}" -o /tmp/serial-sheet.csv
/usr/local/bin/jamf setComputerName -fromFile /tmp/serial-sheet.csv
@JZADC
Copy link

JZADC commented Feb 1, 2023

Update: I got it. I've done some mistakes reading and understanding the script from @AllWorkAndNoPlay .
In the end the mistake was to try adding both scripts together and forget to adding the documentID in the URL from @AllWorkAndNoPlay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment