User & Location Fields

Jae
New Contributor III

Hello all

Is there a way to set a policy to repopulate AD info from the last user field? Would like to send emails to users but some are incorrect or do not exist. We have a new LDAP server since then so we now new machines have no identification except in the last user field.

1 REPLY 1

easyedc
Valued Contributor II

We run this as a policy once a day to grab the last logged in user. It does an effective job of adding those details for us.

#!/bin/sh

lastUser=$(defaults read /Library/Preferences/com.apple.loginwindow lastUserName)
jamf recon -endUsername "$lastUser"

Or we you looking for something different?