On Wed, 14 Aug 2024 11:05:23 +0200 Franta Hanzlik via samba <samba at lists.samba.org> wrote:> Rowland, thank you for response. > But I still think there's nothing stopping Samba from being better > than Windows at this, and introducing some switches like > --displayname > --commonname > --name > --exclude-initials-in-dn > or something similar. > > After all, what are the various attributes displayName/cn/name for, if > they cannot be entered when creating a user. >OK, the 'commonname' or 'cn' is also part of the users 'dn' or RDN and the 'name' must also be the same as the 'cn'. You can use whatever you like for the 'username' when creating a user, but whatever is used will also populate the 'cn', 'name', 'sAMAccountName' and 'distinguishedName' attributes. You can also use the '--use-username-as-cn' to force the use of the username for the 'cn' (and hence the other attributes). There is nothing stopping you writing your own script around 'samba-tool user add' to first create the user (using samba-tool) and then modify it to your purposes, though I struggle to understand why you would want to. Rowland
Dne 2024.08.14 12:06, Rowland Penny via samba napsal:> On Wed, 14 Aug 2024 11:05:23 +0200 > Franta Hanzlik via samba <samba at lists.samba.org> wrote: > >> Rowland, thank you for response. >> But I still think there's nothing stopping Samba from being better >> than Windows at this, and introducing some switches like >> --displayname >> --commonname >> --name >> --exclude-initials-in-dn >> or something similar. >> >> After all, what are the various attributes displayName/cn/name for, if >> they cannot be entered when creating a user. >> > > OK, the 'commonname' or 'cn' is also part of the users 'dn' or RDN and > the 'name' must also be the same as the 'cn'. You can use whatever you > like for the 'username' when creating a user, but whatever is used will > also populate the 'cn', 'name', 'sAMAccountName' and > 'distinguishedName' attributes.Now I see that 'samba-tool user rename' allows to change the displayname and initials as well - so the 'samba-user add' without initials a subsequential 'samba-user rename' command with initials and displayname mostly solves that. The error may also be my understanding of the concept of initials - this can obviously differ between nations/states when multiple names are used, and I am in the grip of our Czech interpretation - in our country only the first name (=given name) and the surname are common, nothing else. And the initials are then the first letter of the first name and the first letter of the surname - so my initials are FH. That's why it seemed pointless to have cn / displayname / name "Franta FH Hanzlik" ;)> You can also use the '--use-username-as-cn' to force the use of the > username for the 'cn' (and hence the other attributes). > > There is nothing stopping you writing your own script around > 'samba-tool user add' to first create the user (using samba-tool) and > then modify it to your purposes, though I struggle to understand why > you would want to.Yes, I did this, thanks.> Rowland-- Franta Hanzlik
Dne 2024.08.14 12:06, Rowland Penny via samba napsal:> On Wed, 14 Aug 2024 11:05:23 +0200 > Franta Hanzlik via samba <samba at lists.samba.org> wrote: > >> Rowland, thank you for response. >> But I still think there's nothing stopping Samba from being better >> than Windows at this, and introducing some switches like >> --displayname >> --commonname >> --name >> --exclude-initials-in-dn >> or something similar. >> >> After all, what are the various attributes displayName/cn/name for, if >> they cannot be entered when creating a user. >> > > OK, the 'commonname' or 'cn' is also part of the users 'dn' or RDN and > the 'name' must also be the same as the 'cn'. You can use whatever you > like for the 'username' when creating a user, but whatever is used will > also populate the 'cn', 'name', 'sAMAccountName' and > 'distinguishedName' attributes. > > You can also use the '--use-username-as-cn' to force the use of the > username for the 'cn' (and hence the other attributes). > > There is nothing stopping you writing your own script around > 'samba-tool user add' to first create the user (using samba-tool) and > then modify it to your purposes, though I struggle to understand why > you would want to. > > Rowland-- The problem is the initials. If I understand their meaning and role correctly, initials are the first letters of the full user's name (first, middle, last name,..) - and what is important, they are/should be a separate element, not part of other forms of the name. Just like is the 'United States' and is its abbreviation 'US', but the term 'United US States' is nonsense. Or, for example, my name is 'Franta Hanzlik', I have the initials 'FH', but the expression 'Franta FH Hanzlik' is nonsense. And this is how entering initials using 'samba-tool user add' / 'samba-tool user rename' behaves badly: when I enter them in user add, they are stuffed into DN, displayName, name, distinguishedName, commonName - although I don't want them there and IMO they have nothing there do. And if I don't specify the initials in user add, then DN, cn, displayName, name, distinguishedName are as I want them (but the initials attribute is missing, of course). And when I add it then, using 'user rename', those initials are stuffed into and change DN, cn, displayName, name, distinguishedName. This is wrong and no wrapper around 'samba-tool user {add,rename}' it won't do! Franta Hanzlik