Username and $user isn’t right when using CIFS/SMB in Owncloud or Nextcloud
For anyone that is setting up Owncloud and using A/D then you need to know one extra important piece of information:
To get it to use the username as the home folder like most people do you need to LDAP\Expert and then add in to Internal Username “sAMAccountName”.
Now the LDAP shares can user $user as the username.
Don’t forget to hit “Clear username-LDAP mappings”.