Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addUser(fName,lName,email,position,team1,team2,phone,ext) {
- var user = {
- name: {
- givenName: fName,
- familyName: lName
- },
- password: 'xxxxxx',
- changePasswordAtNextLogin: true,
- includeInGlobalAddressList : true,
- primaryEmail: email,
- organizations: [
- {
- title: 'ORGANIZATION', //position first after phone number(s)
- primary: true,
- customType: '',
- department: position, //visible after position and seperator
- costCenter: '', //not visible
- name: ''
- }
- ],
- locations: [
- {
- area: 'ORG', //required field
- type: 'default',
- buildingId: 'Team(s): ' + team1, //team1
- floorName: team2 //team2
- }
- ],
- phones: [
- {
- value: phone,
- primary: true,
- type: 'custom',
- customType: 'Ext: ' + ext
- }
- ],
- };
- user = AdminDirectory.Users.insert(user);
- }
- google.script.run.withSuccessHandler(function(serverreturn) {
- console.log("User Added");
- }).addUser(fName,lName,email,position,team1,team2,phone,ext);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement