Hi All,
I have a policy that runs on logout that runs a script to delete all users except the local admin user. I thought this was working fine but I was told by some students that there work was still there when they logged back into the machine. I went back and checked the logs and it indeed shows the policy as failing.
Here is the script that runs:
for dir in /Users/* do if [ ! "$dir" = "/Users/admin" ] && [ ! "$dir" = "/Users/viscom" ] && [ ! "$dir" = "/Users/Shared" ] ; then echo ${dir} rm -R $dir dscl . -delete $dir fi done
exit 0
The error that is showing in the log:
Executing Policy Delete User Script...
Running script Delete User on Logout...
Script exit code: 0
Script result: /Users/pereve DS Error: -14009 (eDSUnknownNodeName) delete: Invalid Path
Any help would be greatly appreciated as I am not very well versed in this.
Thanks,
Pete