3 weeks ago
Hello everyone,
Is there a Terminal command to retrieve the email address used during MDM enrollment ?
Context: I need it to automate the GLPI agent configuration, where the entity assignment is based on the user’s email.
3 weeks ago
Does it have to be the user who enrolled the device?
Fairly certain the user in user and location is defaulted to the user who enrolled the device, you would need to use the API to pull those records in a programatic fashion. Which is likey best done on a dedicated machine and not your Mac fleet, but anyways.
I wrote this, this will grab the current logged in user and append your company email and store the email as a variable.
#!/bin/bash
loggedInUser=$(whoami)
email="${loggedInUser}@yourcompany.com"
echo $email