Select to view content in your preferred language

Create accounts with final passwords using a notebook

890
0
05-16-2022 08:52 AM
Kylie
by Esri Regular Contributor
Esri Regular Contributor
1 0 890

When using ArcGIS in a classroom, the tone of the day is set by how easy it is to get everyone logged in and ready to go. I spend a lot of time helping early elementary students, and having easily remembered passwords is key! When creating accounts, I can set strong, but simple passwords for them. Yet when they log in the first time, they are prompted to change them! And suddenly no one in the room will ever know their password again...

So how can we set students up with passwords they can remember and won't be prompted to change?

The best way is to use single sign-on (SSO) to create the accounts. (This uses the same passwords as other school software, and avoids students having to learn an account or password just for ArcGIS.) However, this isn't an option for all schools and districts. This blog looks at options when SSO is off the table.

Without SSO, a common approach is to sign in to each account after it is created and reset the password for them. But when creating 100 or more accounts, I don't want to undertake that Sisyphean task.

Another option is to create or update the accounts through Python scripting, contained in an ArcGIS Notebook. In a script, you can update the password and set the security question, and then the students won't be prompted to do so when they log in.

Download my notebook to see the full code. I've included comments to help you understand it. However, keep in mind that running a notebook is a more advanced task, so proceed with caution.

Updating the account is the key part of the code, so let's take a look at that line, using arcgis.gis.User.reset:

 

account.reset(password=passwordFinal+'TEMP', 
              new_password=passwordFinal, 
              new_security_question='1', 
              new_security_answer='Your City')

 

This assumes an account password of the final password, followed by TEMP. It then sets the password to the final, desired permanent password, and sets the security question. Security question option 1 is "What city were you born in?" and using that, with an answer of the city where your school is, has served me well. (If you'd like to see all the security choice options, they are listed out as part of the parameters for arcgis.gis.User.update.) Keep in mind that the final password is only as secure as your script makes it. If you are working with older students likely to sign in as other students maliciously, you'll want to choose something safer than password format proposed in the script.

So one line of python that does the heavy lifting, and many fewer password resets in your future!

About the Author
Our kids need GIS in their problem-solving toolboxes. I'm working to get digital maps into each K-12 classroom and the hands of each child. A long-time Esri employee, I've previously worked on Esri's mobile apps, focused on documentation and best practices. Out of the office I'm a runner often found on the trails or chasing my children.