Your SlideShare is downloading. ×
Google apps and Python para Python Brasil [7]
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Google apps and Python para Python Brasil [7]

1,229
views

Published on

Slides for my presentation briefly describing how to automate user management in a google apps for business domain, using python.

Slides for my presentation briefly describing how to automate user management in a google apps for business domain, using python.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,229
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Python & Google Apps Domains
  • 2. Presenter Notes
  • 3. ContatoEduardo Marcel Maçan@eduardomacaneduardomacan@gmail.commacan@debian.org
  • 4. Presenter Notes
  • 5. Como o trabalho deveria serUma nova tarefa chega após o término da anterior
  • 6. Presenter Notes
  • 7. Como ele realmente éUma tarefa demora mais do que o tempo médio de chegada deuma nova
  • 8. Presenter Notes
  • 9. O problema• Número fixo de Contas Google• Número total de funcionários muito próximo ao limite• Rotatividade de Funcionários ◦ Novas contas Precisam ser entregues rapidamente ◦ Antigas contas Precisam ser removidas ◦ Gestores querem acesso a emails antigos, futuros e documentos• Consequência: Demora na entrega de novas contas
  • 10. Presenter Notes
  • 11. A soluçãoAutomatizar:• Transferir documentos google docs para responsável• Download de emails antigos para backup/"acesso offline"• Remover conta antiga• Criar nova conta google apps• Adicionar Alias para responsável• Remover alias para responsável após 30 dias
  • 12. Presenter Notes
  • 13. Enable Google Provisioning APISó funciona para a versão "Business" ou "Educational" do apps(Para testar, você pode habilitar gratuitamente por 30 dias)
  • 14. Presenter Notes
  • 15. WarningIsso significa que se você estiver gerenciando suas contas apartir de outra aplicação/base, contas criadas via web nãoserão autoMAGICAmente importadas para sua baseproprietária e.g. LDAP (duh!)
  • 16. Presenter Notes
  • 17. Sample CodeLists all users in a Domain 1 from getpass import getpass 2 import gdata.apps.service 3 4 DOMAIN = macan.eng.br 5 username = raw_input(Admin account : ) 6 password = getpass(Admin password : ) 7 8 service = gdata.apps.service.AppsService(email=username, domain=DOMAIN, 9 password=password)10 service.ProgrammaticLogin()1112 userfeed = service.RetrieveAllUsers()1314 for user in userfeed.entry:15 print user.login.user_name
  • 18. Presenter Notes
  • 19. Sample CodeCreate a new apps account 1 from getpass import getpass 2 import gdata.apps.service 3 DOMAIN = macan.eng.br 4 username = raw_input(Admin email : ) 5 password = getpass(Admin password : ) 6 7 service = gdata.apps.service.AppsService(email=username, domain=DOMAIN, 8 password=password) 9 service.ProgrammaticLogin()1011 cont = True12 while cont:13 nome = raw_input("Nome : ")14 sobrenome = raw_input("Sobrenome : ")15 login = raw_input("Login : ")16 senha = getpass("Senha : ")1718 service.CreateUser(login, sobrenome, nome, senha )1920 yesno= raw_input(Digite "s" para adicionar outro: )21 cont = yesno=="s" or yesno == "S"22 else:23 print "Saindo..."
  • 20. Presenter Notes
  • 21. Sample CodeAdd an alias 1 from getpass import getpass 2 import gdata.apps.service 3 4 #change this to your google apps domain 5 DOMAIN=macan.eng.br 6 7 username = raw_input(Admin email : ) 8 password = getpass(Admin password : ) 9 olduser = raw_input(Old user login : )10 manager = raw_input(Add alias to : )1112 service = gdata.apps.service.AppsService(email=username, domain=DOMAIN,13 password=password)14 service.ProgrammaticLogin()1516 print "Adding nickname %s to %s" % (olduser,manager)17 service.CreateNickname(manager,olduser)18 print "Feito"
  • 22. Presenter Notes
  • 23. Referências• GData Python Client ◦ http://code.google.com/p/gdata-python-client/ ◦ http://gdata-python-client.googlecode.com/hg/pydocs/gdata.html• IMAP Backup (ferramenta simples em python) ◦ http://tamale.net/imapbackup/• Landslide e Markdown (Esta apresentação) ◦ https://github.com/adamzap/landslide ◦ http://daringfireball.net/projects/markdown/syntax• Apresentação, Fontes e Exemplos ◦ http://eduardo.macan.eng.br/software-livre/apresentacao-pythonbr7-google-apps/
  • 24. Presenter Notes
  • 25. Obrigado!
  • 26. Presenter Notes