t-markmann / nc-userimporter

This tool creates Nextcloud users from a CSV file, which you exported from some other software or created with a spreadsheet software. To disable/enable/delete users, try: https://github.com/t-markmann/nc-usermanager
GNU General Public License v3.0
64 stars 21 forks source link

import user email #13

Open phoenix916 opened 4 years ago

phoenix916 commented 4 years ago

hi I had no email when I import CSV

username;displayname;password;email;groups;subadmin;quota 101297601;Ethan;password;xxxx@yahoo.fr;group;;

the email was not import thanks

rodrigoesborges commented 4 years ago

Same thing for me

phoenix916 commented 4 years ago

all the import without email, after I had manually email

rodrigoesborges commented 4 years ago

Well, as for now I came up with a simple snippet, bash script for doing what I needed. Available at:: gitlab snippet nextcloud user import from csv

Shen commented 4 years ago

I can't reproduce this issue. Can you give more details? (NC Version, your script settings, environment, errors,...)

t-markmann commented 4 years ago

Just tested it with NC18.0.6 and it still works as expected. As Shen said, we need more info here :-)

grafik

didierherisson commented 4 years ago

same error here. Config file:

<config>
<!-- Sensitive data! Delete this information after successful data import -->
    <cloudurl>https://xxxxxx.net/cloud</cloudurl> <!-- CHANGE THIS to your cloud domain, e.g. mycloud.mydomain.org or www.mydomain.org/mycloud (without https://) -->
    <adminname>zzzzzzz</adminname> <!-- CHANGE THIS to your cloud user, who has admin permissions-->
    <!-- Attention: Please note most special characters are not allowed in passwords, including german umlauts -->
    <adminpass>5555555</adminpass> <!-- CHANGE THIS to the password for that user -->
    <!-- Attention: Please note some special characters are not allowed in passwords, avoid using ) } ; # -->

<!-- Settings -->
    <csvfile>PCSI.csv</csvfile> <!-- enter the name of the user-csv-file to be imported. (e.g. teachers.csv). The file must be located in the root directory of the script. Default: users.csv-->
    <csvdelimiter>,</csvdelimiter> <!-- change this to ; if you create your CSV-file with Apple Numbers -->
    <csvdelimitergroups>;</csvdelimitergroups> <!-- change this to , if you create your CSV-file with Apple Numbers -->
    <pdfonedoc>yes</pdfonedoc> <!-- choose 'no' if you want to get a pdf-file for each user. choose 'yes' if you want to get a single pdf-file with all users -->
    <generatepassword>no</generatepassword> <!-- Select yes if you want a password to be generated automatically if no password is specified in user-csv-file. Select no if you want an e-mail to be sent to the user instead with a request to enter a password. In this case a correct e-mail address MUST be entered in the user-csv-file. -->
    <sslverify>False</sslverify> <!-- leave this on True for improved security. If you use a self-signed SSL/TLS certificate, set this to False -->
    <language>fr_FR</language> <!-- all users in the list will be created with this language (and receive the welcome e-mail in this language): de_DE (German/Sie), de (German/Du), en (English), all codes: https://www.transifex.com/explore/languages/ -->

<!-- Special settings for EduDocs-Users (www.edudocs.org) -->
    <EduDocs>no</EduDocs> <!-- change from 'no' to 'yes' if you use this importer for an EduDocs-Instance -->
    <schoolgroup>PCSI</schoolgroup> <!-- change this to 'SchuelerInnen', 'Lehrkraefte' or another groupname you like to import. PAY ATTENTION TO THE SAME SPELLING (SchuelerInnen / Lehrkraefte)!!! -->
</config>

This config file returns for each user something like:

Username: john.doe| Display name: John Doe | Password:  **********| Email: johndoe@gmail.com | Groups: PCSI | Group admin for:  | Quota: 200 MB
/usr/lib/python3.8/site-packages/urllib3/connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host 'damascolle.alwaysdata.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
/usr/lib/python3.8/site-packages/urllib3/connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host 'damascolle.alwaysdata.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
failure 102 = Invalid language

NC version is 19.0.0

t-markmann commented 4 years ago

@didierherisson could you try it again with a valid language (see the list behind the option)?

The warning for unverified HTTPS request is correct and expected, because of False.

didierherisson commented 4 years ago

fr_FR is in the list: French (France) (fr_FR) says https://www.transifex.com/explore/languages/

with fr as langage, user is created with correct email associated.

I have another error after this step: FileNotFoundError: [Errno 2] No such file or directory: 'assets/Nextcloud_Logo.jpg' Maybe because I should run the script from the server? but i don't care, if the users are created, the job is done, It's ok for me, i don't need more.

Thank you for the script anyway!

brtptrs commented 4 years ago

I tried this on NC20 from a linux terminal with the latest download version. The import worked great except for the email-field which was missing on all new accounts. The language setting in both NC20 and the config.xml was set do "de".

rodrigoesborges commented 4 years ago

the email-field which was missing

Did you try the snippet I provided?

with a simple snippet, bash script for doing what I needed. Available at:: gitlab snippet nextcloud user import from csv

brtptrs commented 4 years ago

@rodrigoesborges no, for me this was a one-time action so I'm not investing any more time. My comment was just some quick feedback.

t-markmann commented 3 years ago

Error is caused by the "send mail" checkbox. https://help.nextcloud.com/t/import-many-users/2453/19