Clean user profile, every log in? I have a series of local accounts on a El Capitan (Need to stay on 10.11.6 due to app compatability). I want these accounts to get the "default profile" every time they log in. I mean * absolutely clean* - new desktop, downloads, settings and preferences.. I want it all gone.

I go about this by having a logout script that simply deletes the home folder, such as:

sudo rm -R /Users/myusername


This way the user and password is retained, but all rubbish that was left on the account is gone, and clean for the next login.

This works absolutely fine, except... the dock has three question marks on it when the user logs back in until the machine is rebooted. The question marks relate to three applications that are not installed on the Mac (Keynote, Pages, and Numbers). This problem happens from a clean download and install of OS X using the recovery utility.

Does anyone have any ideas why this might be happening? Or does anyone have another method of destroying the home folder that I can try?
The dock is being populated with default items by way of /System/Library/CoreServices/Dock.app/Contents/Resources/en.lproj/default.plist.  This is protected via SIP though.  So you can try the obvious (and non recommended) method of disabling SIP to mess with the plist.  There are other options.


Use dockutil in a login script to add/remove/etc. whatever icons you desire.
Customize the dock as you want it to be, and copy ~/Library/Preferences/com.apple.dock.plist. Have a login script replace the default
dock plist with the backup, then kill the dock and maybe cfprefsd.
Management suites, such as Casper, can manage the dock
remotely.  


See https://www.jamf.com/jamf-nation/discussions/18357/el-capitan-user-template-dock-customisation-issue