Skip to content

curl

Rename Computer using Scripting and Google Sheets

Google has made some changes that made this script not work, but it was an easy fix, once I bothered to look at why it wasn’t working. The page redirects to another page, and thus the cURL doesn’t work as usual. Instead you need to add the redirect flag to the cURL command so, instead of: You want: So the full script would be:

Rename Computer using Scripting and Google Sheets

UPDATE: You need to allow redirects in your cURL by adding -L. See this post. With Apple’s Device Enrollment program, when a organization-owned device first turns on, it checks in with Device Enrollment and gets the information to know what MDM is managing it and how to contact it. That MDM system can then install what’s known as a bootstrapping package. In our old bootstrapping package, which was developed by an employee no longer here, was a giant if statement. If SerialNumber = x then set ComputerName to Bob, elseif SerialNumber = y then set ComputerName to Frank, elseif SerialNumber = z then set ComputerName to Jane. Pretty simple and… Read More »Rename Computer using Scripting and Google Sheets