Not tried it but just put this together to get you going. It needs the code to check Active/Inactive for the user in AD, but in theory, if attached to a policy to run at login, it should update the location information, clearing out whats there.
#!/bin/sh
apiUser="your_api_username"
apiPass="your_api_password"
if [ result_of_above_test == "Inactive"]; then
serial=$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print $NF}')
cat <<EOF > /private/tmp/$serial.xml
<computer>
<location>
<username></username>
<real_name></real_name>
<email_address></email_address>
<position></position>
<phone></phone>
<department></department>
<building>Roaming</building>
<room><room/>
</location>
</computer>
EOF
apiURL=$(defaults read /Library/Preferences/com.jamfsoftware.jamf jss_url | sed 's:/*$::')
curl -sfku $apiUser:$apiPass $apiURL/JSSResource/computers/serialnumber/$serial/subset/location -T /private/tmp/$serial.xml -X PUT > /dev/null
rm /private/tmp/$serial.xml
fi
exit 0
Instead of using the API, you can just run recon with the -username and other parameters. see 'jamf help recon' for more info.
That's was my first thought. Would it work to remove details? Would be a lot easier if it did.
If I recall correctly from another thread, you can't use the jamf recon syntax to remove location information, only to assign it or update it. It won't accept a blank value I believe.
I've actually never used Recon. I will look into that as an option as well, thank you!