ghe‐reset‐user‐email - elliottcarlson/ghe GitHub Wiki

This utility enables resetting emails of Github Enterprise users from the command line. Github Enterprise does not provide access to this functionality via an API or utility, outside of the admin interface.

To accomplish this, we utilize the Python Selenium binding with PhantomJS. This allows us to login as an administrative user, locate and verify the correct user is being selected, and both add the desired email address to the users account, but also send a password reset email to the newly added account.

As with all scripts being run from within GHE CLI, the ghe-host, ghe-user, ghe-pass, ghe-totp are automatically set via the localized environment and do not need to be provided on the command line.

Set a users email via their username:

GHE> reset-user-email username [email protected]
Setting "username" email address to "[email protected]"...
Email added and password reset email sent.
GHE>

Help

GHE> reset-user-email -h
usage: ghe-reset-user-email.py [-h] [-ghe-host HOST] [-ghe-user USER]
                               [-ghe-pass PASS] [-ghe-totp KEY] [-debug]
                               USERNAME EMAIL

Tool to update a users email address on Github Enterprise.

positional arguments:
  USERNAME        username to update
  EMAIL           email address to set.

optional arguments:
  -h, --help      show this help message and exit
  -ghe-host HOST  the hostname to your GitHub Enterprise server (default:
                  value from `ghe-host` environment variable)
  -ghe-user USER  username of a Github Enterprise user with admin priveleges.
  -ghe-pass PASS  password of user passed in with -ghe-user.
  -ghe-totp KEY   base 32 secret to generate two-factor key
  -debug          enable debug mode
GHE>
⚠️ **GitHub.com Fallback** ⚠️