Computer names and users getting wiped at re-enrollment

TheRick
New Contributor

Hello,

When re-enrolling our devices via DEP, the computer name from the Jamf inventory is reverting to the default (e.g. MacBook Air), and the assigned user and information is completely lost/wiped, and it all needs to be reentered. The only field that seems to stick in Jamf on re-enrollment is the Asset Tag.

I have made sure that the clear user info checkboxes are not ticked in the Re-Enrollment settings:Screen Shot 2021-08-11 at 4.31.06 PM.png

Is there a reliable way to retain the computer information entered into JAMF when performing a re-enrollment so it doesn't have to be reentered each time?

Thanks!

1 REPLY 1

bwoods
Valued Contributor

Not sure why this is happening, but you can add my script below in combination with DEPNotify or however you're provisioning to repopulate the user info. 

 

# jamfProUserInfo.sh
# Brandon Woods
# June 2021
# This script locates the current user and updates Jamf Pro with user details


jamfBinary="/usr/local/bin/jamf"
currentUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'`
fullName=`dscl . -read /Users/$currentUser RealName | tail -1`
emailAddress="$currentUser@dnb.com"


# Update username in Jamf Pro

echo $currentUser
echo $fullName
echo $emailAddress

# Set username in Jamf Pro
sudo $jamfBinary recon -endUsername "$currentUser"

# Set full name in Jamf Pro
sudo $jamfBinary recon -realname "$fullName"

# Set email address in Jamf Pro
sudo $jamfBinary recon -email "$emailAddress"

# Exit Script

exit 0		## Success
exit 1		## Failure