Skip to content

Instantly share code, notes, and snippets.

@colinramsay
Created January 9, 2011 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save colinramsay/771820 to your computer and use it in GitHub Desktop.
Save colinramsay/771820 to your computer and use it in GitHub Desktop.
Change the username of one or more Google Apps users in your domain
import gdata.apps.service
service = gdata.apps.service.AppsService(email="admin@mydomain", domain="mydomain.com", password="password")
service.ProgrammaticLogin()
names = {'from':'to'}
for current, change_to in names.iteritems():
user_entry = service.RetrieveUser(current)
user_entry.login.user_name = change_to
service.UpdateUser(current, user_entry)
print user_entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment