Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. function addUser(fName,lName,email,position,team1,team2,phone,ext) {
  2. var user = {
  3. name: {
  4. givenName: fName,
  5. familyName: lName
  6. },
  7. password: 'xxxxxx',
  8. changePasswordAtNextLogin: true,
  9. includeInGlobalAddressList : true,
  10. primaryEmail: email,
  11.  
  12. organizations: [
  13. {
  14. title: 'ORGANIZATION', //position first after phone number(s)
  15. primary: true,
  16. customType: '',
  17. department: position, //visible after position and seperator
  18. costCenter: '', //not visible
  19. name: ''
  20. }
  21. ],
  22. locations: [
  23. {
  24. area: 'ORG', //required field
  25. type: 'default',
  26. buildingId: 'Team(s): ' + team1, //team1
  27. floorName: team2 //team2
  28. }
  29. ],
  30. phones: [
  31. {
  32. value: phone,
  33. primary: true,
  34. type: 'custom',
  35. customType: 'Ext: ' + ext
  36. }
  37. ],
  38. };
  39. user = AdminDirectory.Users.insert(user);
  40. }
  41.  
  42. google.script.run.withSuccessHandler(function(serverreturn) {
  43. console.log("User Added");
  44. }).addUser(fName,lName,email,position,team1,team2,phone,ext);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement