User Tools

Site Tools


public:importing_user_csv_file_via_xml_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
public:importing_user_csv_file_via_xml_api [2021/04/16 16:07]
rhudak created
public:importing_user_csv_file_via_xml_api [2021/04/16 16:34]
rhudak
Line 41: Line 41:
   C:\Users\John> pip install requests python-certifi-win32 --cert mycacert.pem   C:\Users\John> pip install requests python-certifi-win32 --cert mycacert.pem
  
 +===== Prepare your csv file =====
  
 +This script expects you to provide a csv file, with fields separated by commas. The file must have the following columns - **Name, Username, Password, Email Address, Group**:
  
 +Example:
 +  Name,Username,Password,Email Address,Group
 +  Nigel Brown,nbrown,Pa5s!w0rd19,nigel.brown@example.com,Open Group
 +  Gina Lopez,glopez,e1Azjr8q9^21,gina.lopez@example.com,Open Group
 +
 +===== Downloading and running the script =====
 +
 +1) Download this [[https://community.sophos.com/cfs-file/__key/communityserver-discussions-components-files/258/userimport_2D00_py.zip | zip]] and extract it to a directory on your computer. The rest of these instructions assume you saved it in **'Downloads'**, and that the csv file containing the users you want to add is in **'Documents'** and called **users.csv**
 +
 +2) Run the following command, substituting your firewall's hostname or IP address, admin username and password. 
 +  python3 Downloads\UserImport.py -f x.x.x.x -i Documents\users.csv -u admin -p A1B2c3d4!!E5 -a
 +  
 +3) If you see exception messages related to certificate trust issues, try running the same command again, but add '-n' as an additional command-line qualifier. 
 +  python3 Downloads\UserImport.py -f x.x.x.x -i Documents\users.csv -u admin -p A1B2c3d4!!E5 -a -n
 +
 +===== Troubleshooting =====
 +
 +=== 1) If you get an error message of the connection timing out: ===
 +
 +Confirm what port is being utilized in the Admin settings 
 +  
 +1) Go to **Administration** -> **Admin and User Settings**
 +
 +2) Under **Admin console and end-user interaction** check the **Admin console HTTPS port**
 +       
 +* The default for the python program is port **4444**
 +
 +* If your port is different edit the text on **line 175/6** of the Python code; it should then read
 +          callurl = ('https://' + stuff.firewall +
 +                   ':4444/webconsole/APIController')
 +=== 2) My passwords do not meet password complexity ===
 +  Line 36 (sci35), Status 510
 +     Invalid password - doesn't meet complexity requirements
 +     
 +1) Go to **Administration** -> **Admin and User Settings** -> **User password complexity settings**
 +
 +2) Disable **Enable password complexity check**
 +
 +3) Reboot device and double check that **Enable password complexity check** is still disabled
 +
 +4) Re-run the python command
 + 
  
public/importing_user_csv_file_via_xml_api.txt ยท Last modified: 2021/04/19 15:02 by rhudak