lam icon indicating copy to clipboard operation
lam copied to clipboard

CSV user import with autocreation of primary group

Open tmotyl opened this issue 6 months ago • 5 comments

when creating a new user In the UI, the primary group is set with option "create_group_with_same_name", which autocreates the new group with the same name as the user.

Can this be also achieved using csv import? I tried putting the name in the "posixAccount_group" column, or leaving it empty or using "magic" value of "create_group_with_same_name" but nothing worked.

tmotyl avatar May 13 '25 14:05 tmotyl

This is not supported as part of the file upload as it can be achieved with two file uploads (first groups, then users).

gruberroland avatar May 13 '25 15:05 gruberroland

Thanks for the info. My case is that I have to create single users, multiple times, not many users one time. So having a separate import just for group is an additional hurdle. Would you be open for PR implementing this feature (support for create_group_with_same_name in the import file)?

tmotyl avatar May 14 '25 09:05 tmotyl

Is there any reason why you prefer the CSV instead of the regular GUI to create single users? Just to know if there is room for improvement.

Sure, if you provide a PR we will be happy to integrate it.

gruberroland avatar May 14 '25 19:05 gruberroland

I prefer CSV as then I can generate the csv to avoid mistakes (these are "service users" which have some custom settings like different home path), as I can generate the file via script.

tmotyl avatar May 14 '25 20:05 tmotyl

I solved the issue for now by creating a profile for new users in LAM UI. In long term I will try to create user directly through OpenLdap API.

tmotyl avatar Jun 10 '25 12:06 tmotyl