Thanks, I put this script in my server and tried it with the trigger of once per user. This is the log I got on from my test computer.
Executing Policy Name Change...
Running script accountchange.sh...
Script exit code: 54
Script result: User entered the full name of please work
attribute status: eDSAttributeNotFound DS Error: -14134 (eDSAttributeNotFound)
Running Recon...
Retrieving inventory preferences from https://server.org:8443/...
Locating accounts...
Locating package receipts...
Searching path: /Users
Locating software updates...
Locating plugins...
Locating printers...
Searching path: /Applications
Gathering application usage information...
@lpadmin,
Change the line for the "CurrName" from-
CurrName=$(dscl . read /Users/${loggedInUser} RealName | awk '{getline; print}' | sed 's/^ *//')
To
CurrName=$(dscl . read /Users/${loggedInUser} RealName | awk -F: '{print $NF}' | sed -e 's/^ *//;/^$/d')
The "student" accounts may not be putting the full name on a new line, in which case my getline in the awk part would grab the wrong information, hence the eDsAttributeNotFound error (just a theory).
The above new line should work if the name is short and appears on the same line in dscl or on a second line.
That works, again I can not thank you enough for writing these scripts for me.