I use nextcloud with Active Directory grıup membership.
When I add user into AD grıup user created in Nextcloud side but not wiht logon name or SAMAccountname. It creates by Object GUID.
For example my username is tevfikceydelikler and my object GUID is 99 8F E9 2B 69 89 EA 4C 9F 71 FC 6C B5 97 07 95
When I add myself to NexctCloud AD group, My username is becomes: 2BE98F99-8969-4CEA-9F71-FC6CB5970795
And OS sees like:
IS there any way to create user by SAMAccountname?
Yes this is possible. Sorry I do not have the answer ready straight out of my mind. However I am pretty sure it is possible. If my memory do not fails me, look at the matching policy (attribute for uniqueness). I am pretty sure NC creates users folders with their unique userid.
It will not automatically change the folder names of each user for any existing users after that modification. In fact you can verify that Nextcloud calculates the user paths to data/sAMAccountName by adding the users data path to your users admin overview (the gear in the bottom left, checkmark for userpaths). Then what you needs to do (unfortunately but easy to work with) is to rename each users folder.
Example. Lets assume we have John Doe with the sAMAccountName=jodo and the UUID=6bf36926-0f6c-103b-95c0-0f67437e8985:
Did you read what I wrote? Yes NC can do that mapping. But for obvious reason it does not pull the plug of users cache, indices, previews and other stuff “automatically”, which is why setting this option does not - automatically - change it for existing users (as in existing nextcloud users). ANY new nextcloud user will be created using the new naming standard. So for this to also affect existing users, you has to follow a manuel approach, which also includes re-building indices, cache, previews and so on, for each existing nextcloud user folders only.