We have tested what is posted above and it seems to work well for us.
Just want to note that others will want to modify the accounts that are
ignored in the "for i" line.
The way I got this to work with an existing user who was having the
issue, was to uncheck "Use UNC path from Active Directory to derive
network home location", delete the account and home folder for the user.
Recreate the mobile account and I have re...