We use Google login to enroll our users in JAMF. We were told by JAMF engineers during our setup, that we could use Google SSO for the login OR leverage Google LDAP. If we setup LDAP, then we'd have an extra step of pre-populating users and groups in the JAMF settings in order to use SSO. We don't want to have to pre-populate or manage users in the settings. So LDAP is not currently enabled. When our users login through SSO for the first time, their Username (which is their email address) is automatically captured in "User and Location", which is great. However, we have another system that will sync asset information, but it is hard coded to use the Email Address field. Is there any way to easily script setting the Email Address field to what is already populated in the Username field?
Solved
Setting email address in the User and Location Information to match existing Username

Best answer by Wendy-G
I finally resolved this. I am able to retrieve the current username from "User and Location" and then set it in the email address field. I used this article to fetch the username into a variable called $username: https://community.jamf.com/t5/jamf-pro/using-data-in-jss-within-scripts/td-p/111574
In that article, I used the example that utilizes the serial number. So in my script, i retrieved the serial number with:
serialNumber=$(ioreg -c IOPlatformExpertDevice -d 2 | awk -F\\" '/IOPlatformSerialNumber/{print $(NF-1)}')
Then I used the following command to set the email to match the $username
sudo jamf recon -email $username
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.