How to automatically create a set of folders for a new user

Testing an install now for a client to use for their outside reps. Is it possible through scripting and or the API to create a series of folders/shares automatically when a new user is added.

So if I add user “mike”, a new “Mike @ Department” folder is created with 5 additional subfolders, which then automatically gets shared with Mike so when he logs in the “Mike @ Department” folder is there for him to use?

What about reading the administrator guide which has explicitly been written to answer many initial questions :wink:

It’s ok you say you don’t know the answer. The guide details skeleton files. I did not ask about skeleton files. I asked about creating shares automatically when a new user is created. User “A” would have a folder created called “Mikes Data”, that folder would then be shared automatically with the user Mike.

What about reading the question instead.

Sorry, you’re right, I missunderstood your requirement.

Nevertheless who should own the shared folders? If you create a new user, you can let the system automatically create the desired sub-directory structure for this user under the <Nextcloud-data-directory>/Mike/files directory. You cannot let Nextcloud create sub-folders which are owned by someone else which are then shared to the user.

A possible way would be to create shared folders in advance, assign these folders to a specific group, e.g. “Department” and get the new user “Mike” automatically be added to that group, using [Auto Groups app](the https://apps.nextcloud.com/apps/auto_groups),