Manage mailbox delegation using serviceaccount

357 views
Skip to first unread message

Andrea

unread,
May 13, 2019, 6:46:13 AM5/13/19
to Google Apps Script Community
Goodmorning everyone.
I would like to write an application/script that allows adding/removing delegates to a mailbox using a service account.
I found a working code (reported below) that sets the signature to us...@mydomain.com
I don't understand how to modify it to be able to add (or remove) a delegate. 

Unfortunately I can't find a code to help me.
Would anyone be kind enough to give me help?

Thanks in advance for your very useful help
Andrea

EXAMPLE SCRIPT (WORK FOR SIGNATURE):
function setSignatureTest() {
  var email = 'us...@mydomain.com';
  var signature = 'test signature';
  var test = setSignature(email, signature);
  Logger.log('test result: ' + test);
}


function setSignature(email, signature) {
  Logger.log('starting setSignature');
  var signatureSetSuccessfully = false;
  var service = getDomainWideDelegationService('Gmail: ', 'https://www.googleapis.com/auth/gmail.settings.basic', email);
  if (!service.hasAccess()) {
    Logger.log('failed to authenticate as user ' + email);
    Logger.log(service.getLastError());
    signatureSetSuccessfully = service.getLastError();
    return signatureSetSuccessfully;
  } else Logger.log('successfully authenticated as user ' + email);

  var username = email.split("@")[0];
  var resource = { signature: signature };

  var requestBody                = {};
  requestBody.headers            = {'Authorization': 'Bearer ' + service.getAccessToken()};
  requestBody.contentType        = "application/json";
  requestBody.method             = "PUT";
  requestBody.payload            = JSON.stringify(resource);
  requestBody.muteHttpExceptions = false;

  var emailForUrl = encodeURIComponent(email);
  var maxSetSignatureAttempts     = 20;
  var currentSetSignatureAttempts = 0;

  do {

    try {

      currentSetSignatureAttempts++;
      Logger.log('currentSetSignatureAttempts: ' + currentSetSignatureAttempts);
      var setSignatureResponse = UrlFetchApp.fetch(url, requestBody);
      Logger.log('setSignatureResponse on successful attempt:' + setSignatureResponse);
      signatureSetSuccessfully = true;

      break;

    } catch(e) {

      Logger.log('set signature failed attempt, waiting 3 seconds and re-trying');

      Utilities.sleep(3000);

    }

    if (currentSetSignatureAttempts >= maxSetSignatureAttempts) {

      Logger.log('exceeded ' + maxSetSignatureAttempts + ' set signature attempts, deleting user and ending script');

      throw new Error('Something went wrong when setting their email signature.');

    }

  } while (!signatureSetSuccessfully);

  return signatureSetSuccessfully;

}

// these two things are included in the .JSON file that you download when creating the service account and service account key
var OAUTH2_SERVICE_ACCOUNT_PRIVATE_KEY  = '-----BEGIN PRIVATE KEY-----\nMIIEvQIBAD.....bc\nSQTO59jfRT/tfc=\n-----END PRIVATE KEY-----\n';
var OAUTH2_SERVICE_ACCOUNT_CLIENT_EMAIL = 'gam-...@xxxx.iam.gserviceaccount.com';


function getDomainWideDelegationService(serviceName, scope, email) {

  Logger.log('starting getDomainWideDelegationService for email: ' + email);

  return OAuth2.createService(serviceName + email)
      // Set the endpoint URL.

      // Set the private key and issuer.
      .setPrivateKey(OAUTH2_SERVICE_ACCOUNT_PRIVATE_KEY)
      .setIssuer(OAUTH2_SERVICE_ACCOUNT_CLIENT_EMAIL)

      // Set the name of the user to impersonate. This will only work for
      // Google Apps for Work/EDU accounts whose admin has setup domain-wide
      // delegation:
      .setSubject(email)

      // Set the property store where authorized tokens should be persisted.
      .setPropertyStore(PropertiesService.getScriptProperties())

      // Set the scope. This must match one of the scopes configured during the
      // setup of domain-wide delegation.
      .setScope(scope);

}

Reno Blair

unread,
May 13, 2019, 10:57:28 AM5/13/19
to google-apps-sc...@googlegroups.com
Start with the documentation.

You will need to add the necessary scopes to your service account. From there it's just a matter of creating a copy of your existing function with the correct scope, url, HTTP method, and payload. For example, here are some example values to create a delegate request.

url: "https://www.googleapis.com/gmail/v1/users/" + email + "/settings/delegates"
method: "PUT"
payload: JSON.stringify({
  delegateEmail: email2
  verificationStatus: "pending"
})

Once you get the process down, you might refactor your code to be a little more DRY and reusable, as all service account actions follow roughly the same flow.


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/bfcbd04c-6fea-4e49-a708-a41a86df7169%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Reno Blair
Educational Technology Services​

Andrea

unread,
May 14, 2019, 6:44:38 AM5/14/19
to Google Apps Script Community
Dear Reno,
thanks for your reply.

Now the script work! Yeah!

Now that the script works,
I would like to create a very simple Google application (just to understand how these tools work). 
I would like a button that on click event, will execute the setSignatureTest () function.

I'm trying to do some tests, with no results!

I don't understand how to link the SetSignatureTest() function to the OnClick event button.

I tried to copy the whole script in the custom action of the button but that doesn't work.
Can I use the script as it is or should it be rewritten to make it compatible with App Maker?


Do you have a suggestion on how to do it? I would really appreciate it.
I apologize if I take advantage of your help.
GRAZIE
Andrea



To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Reno Blair

unread,
May 14, 2019, 10:34:44 AM5/14/19
to google-apps-sc...@googlegroups.com
If you want a button in a client environment (webapp/sidebar/custom dialog) to call the apps script function, you will want to review the client to server communication guide. Basically, your onClick event handler will call the server side function via google.script.run.SetSignatureTest(). I would recommend adding success and failure handlers as described in the google.script.run documentation. You may even consider turning google.script.run... into a promise:

var calledSetSigTest = new Promise((resolve, reject) => google.script.run.withSuccessHandler(resolve).withFailureHandler(reject).SetSignatureTest());
calledSetSigTest
.then(response => console.log("SetSignatureTest finished") && console.log(response))
.catch(error => console.error("SetSignatureTest failed") && console.error(error));


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.


--
Reno Blair
Educational Technology Services​

IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrea

unread,
May 15, 2019, 6:36:22 AM5/15/19
to Google Apps Script Community
Reno, I thank you so much!
The call to the google.script.run.SetSignatureTest () function from a button worked correctly. I will do further tests.
Thanks thanks thanks

Good day
Andrea


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Andrea

unread,
May 15, 2019, 12:27:28 PM5/15/19
to Google Apps Script Community
Good evening Reno,
can I ask you for help again?
Thanks to your suggestions, I managed to set up a delegation between two users using a Service Account
Now I would like to write a script that reads all user's mail delegations.
This is the Reference API 

In this page I found:
Request body--> Do not supply a request body with this method.

I try to use the API in this way:

//check Delegation......
var service = getDomainWideDelegationService('Gmail: ', 'https://www.googleapis.com/auth/gmail.settings.basic', email);

if (!service.hasAccess()) {
Logger.log('failed to authenticate as user ' + email);
} else Logger.log('YEAH-Successfully authenticated as user ' + email);
var GetDelegationResponse = UrlFetchApp.fetch(url);
}

The error is :
YEAH-Successfully authenticated as user my_e...@MyDomain.com
attempt:{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}



How can I use/pass the Service Account?
I have to pass requestBody parameters when I use UrlFetchApp.fetch(url) ?
Which parameters I have to pass ?

I'm trying with this parameters but without success
  var requestBody                = {};
  requestBody.headers            = {'Authorization': 'Bearer ' + service.getAccessToken()};
  requestBody.contentType        = "application/json";
  requestBody.method             = "GET";
  requestBody.payload            = JSON.stringify(
                                  {
                                        delegateEmail: email,
verificationStatus: "accepted"});


I'm so sorry ... I'm taking advantage of your patience!
Grazie-Thanks

Best regards
Andrea

Reno Blair

unread,
May 15, 2019, 3:06:19 PM5/15/19
to google-apps-sc...@googlegroups.com
Here's what it should look like:

var service = ... (get your service account for the given user)
var params = {
  headers:{
    Authorization: "Bearer " + service.getAccessToken()
  },
  method: "GET"
};
var delegationResponse = UrlFetchApp.fetch(url, params);



IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.

For more options, visit https://groups.google.com/d/optout.

Andrea

unread,
May 16, 2019, 3:32:54 AM5/16/19
to Google Apps Script Community
Reno,
Your code work perfectly. As usual :)
I hug you !!

I thank you very much for your help.
Andrea
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Andrea

unread,
May 16, 2019, 11:13:13 AM5/16/19
to Google Apps Script Community
Reno, sorry again.
I have been doing tests all day ... loser!

I can't use this API.



I need to get all the users that have a certain domain (for example ItalyDomain.it)

Do you have an example (with Service Account)  from which to take inspiration?

I apologize if I'm stressing you these days.
I really feel like a goat :(
Thank you

On Wednesday, 15 May 2019 21:06:19 UTC+2, Reno Blair wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Reno Blair

unread,
May 16, 2019, 11:55:21 AM5/16/19
to google-apps-sc...@googlegroups.com
I don't think I've used the Users API before, but getting all users in the ItalyDomain.it domain might look something like this:

var params = {
  headers: {
    Authorization: "Bearer " + token,
  method: "GET"
  payload: {
    domain: "ItalyDomain.it",
    maxResults: 500,
  }
};
var users = [];
do {
  var response = UrlFetchApp.fetch(url, params).getContentText();
  users = users.concat(response.users);
  params.payload.pageToken = response.nextPageToken;
} while (params.payload.pageToken != void 0);
return users;

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.


--
Reno Blair
Educational Technology Services​

IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrea

unread,
May 17, 2019, 8:47:12 AM5/17/19
to Google Apps Script Community
Good morning Reno,
Thank you for your answer.
Your code seems to work properly (thanks).
Unfortunately I got an error:

With this code

  var params                = {};
  params.headers            = {'Authorization': 'Bearer ' + service.getAccessToken()};
  params.contentType      = "application/json";
  params.method             = 'GET';
  params.payload            = JSON.stringify(
                                  { domain: "MyDomain.it",
  maxResults: 500});
  params.muteHttpExceptions = true;

Error is:
"error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Given/Family Name: FamilyName"
   }
  ],
  "code": 400,
  "message": "Invalid Given/Family Name: FamilyName"
 }
}


With this code (contentType removed)

  var params                = {};
  params.headers            = {'Authorization': 'Bearer ' + service.getAccessToken()};
  //params.contentType        = "application/json";  
  params.method             = 'GET';
  params.payload            = JSON.stringify(
                                  { domain: "MyDomain.it",
  maxResults: 500});
  params.muteHttpExceptions = true;

Error is:
"error": {
  "errors": [
   {
    "domain": "global",
    "reason": "parseError",
    "message": "This API does not support parsing form-encoded input."
   }
  ],
  "code": 400,
  "message": "This API does not support parsing form-encoded input."
 }
}

Do you have an idea ?
Thank you so much for your help. You are really kind.
Good day
Andrea
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Reno Blair

unread,
May 17, 2019, 11:48:11 AM5/17/19
to google-apps-sc...@googlegroups.com
My mistake. Instead of passing the parameters as a payload, they are attached to the request url:
var urlParams = {
  domain: "domainName.com",
  maxResults: 500,
};
var params = {
  headers: {
    Authorization: "Bearer " + token,
  },
  method: "GET",
};
var users = [];
do {
  var parameterString = Object.keys(urlParams).map(function(k) {
    return  k + "=" + encodeURIComponent(urlParams[k]);
  }).join("&");
  var targetUrl = url + (!url.includes("?") ? "?" : (url.charAt(url.length -1) == "&" ? "" : "&")) + parameterString;
  var response = JSON.parse(UrlFetchApp.fetch(targetUrl, params).getContentText());
  users = users.concat(response);
  urlParams.pageToken = response.nextPageToken;
} while (urlParams.pageToken != void 0);
console.log(users);

You may need the String.prototype.includes polyfill as well:
if (!String.prototype.includes) {
  Object.defineProperty(String.prototype, 'includes', {
    value: function(search, start) {
      if (typeof start !== 'number') {
        start = 0
      }
      
      if (start + search.length > this.length) {
        return false
      } else {
        return this.indexOf(search, start) !== -1
      }
    }
  })
}


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.


--
Reno Blair
Educational Technology Services​

IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrea

unread,
May 17, 2019, 4:18:55 PM5/17/19
to Google Apps Script Community
Ciao Reno.
Thanks for your reply but the code not work :(
var token = service.getAccessToken()
var urlParams = {
  domain: "mydomain.it",
  maxResults: 500,
};
var params = {
  headers: {
    Authorization: "Bearer " + token,
  },
  method: "GET",
};


var users = [];
do {
  var parameterString = Object.keys(urlParams).map(function(k) {
    return  k + "=" + encodeURIComponent(urlParams[k]);
  }).join("&");
  var targetUrl = url + (!url.includes("?") ? "?" : (url.charAt(url.length -1) == "&" ? "" : "&")) + parameterString;
  var response = JSON.parse(UrlFetchApp.fetch(targetUrl, params).getContentText());
  users = users.concat(response);
  urlParams.pageToken = response.nextPageToken;
} while (urlParams.pageToken != void 0);
console.log(users);

The error is:
Execution failed: TypeError: Cannot find function includes 
in object https://www.googleapis.com/admin/directory/v1/users. (line 56, file "GetAllUsers")

The line 56 is
var targetUrl = url + (!url.includes("?") ? "?" : (url.charAt(url.length -1) == "&" ? "" : "&")) + parameterString;

I'm afraid it's too hard for me that I don't know javascript!
I thank you for the time you are dedicating to me!
Best regards
Andrea

Venerdì 17 maggio 2019 17:48:11 UTC + 2, Reno Blair ha scritto:
Errore mio. Invece di passare i parametri come payload, vengono allegati all'URL della richiesta:
var urlParams = {
  dominio : "domainName.com" ,
  maxResults : 500 ,
};
var params = {
  intestazioni : {
    Autorizzazione : "Portatore" + gettone,
  },
  metodo : "OTTIENI" ,
};
var users = [];
fai {
  var parameterString = Object .keys (urlParams) .map ( fun ction ( k ) {
    return   k + "=" + encodeURIComponent (urlParams [ k]);
  }). join ( "&" );
  var targetUrl = url + (! url.includes ( "?" )? "?" : (url.charAt (url.length -1 ) == "&" ? "" : "&" )) + parameterString;
  var response = JSON .parse (UrlFetchApp.fetch ( targetUrl, params) .getContentText ());
  users = users.concat (response);
  urlParams.pageToken = response.nextPageToken;
} while (urlParams.pageToken! = void 0 );
console .log (utenti);

Potrebbe essere necessario il String.prototype.include anche polyfill:
if (! String .prototype.includes) {
  Object .defineProperty ( String . Prototype, 'includes' , {
    valore : funzione ( ricerca, inizio ) {
      if ( typeof start! == 'number' ) {
        inizio = 0
      }
      
      if (start + search.length> this .length) {
        return false
      } else {
        restituisci questo .indexOf (search, start)! == -1
      }
    }
  })
}


Il ven, 17 maggio 2019 alle 17:47 Andrea < andrea .... @ consulente. solgroup.com > ha scritto:
Buongiorno Reno,
La ringrazio per la risposta.
Il tuo codice sembra funzionare correttamente (grazie).
Purtroppo ho ricevuto un errore:

Con questo codice

  var params = {};
  params.headers = {'Autorizzazione': 'Bearer' + service.getAccessToken ()};
  params.contentType = "application / json";
  params.method = 'GET';
  params.payload = JSON.stringify (
                                  { dominio: "MyDomain.it",
  maxResults: 500});
  params.muteHttpExceptions = true;

L'errore è:
"errore": {
  "errori": [
   {
    "dominio": "globale",
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



-
Hai ricevuto questo messaggio perché sei iscritto al gruppo "Google Apps Script Community".
Per annullare l'iscrizione a questo gruppo e interrompere la ricezione di email da esso, invia un'email a google-apps-script-community + unsub...@googlegroups.com .
Visita questo gruppo all'indirizzo https://groups.google.com/ group / google-apps-script- community .
Per visualizzare questa discussione sul Web, visita https://groups.google.com/d/ msgid / google-apps- script-community / d19d310e-eb9a-4a8c- ae8f-c1f81ad19484% 40googlegroups.com .
Per ulteriori opzioni, visita https://groups.google.com/d/ optout .


-
Reno Blair
Servizi di tecnologia educativa

Reno Blair

unread,
May 17, 2019, 5:01:19 PM5/17/19
to google-apps-sc...@googlegroups.com
change
!url.includes("?")
to
url.indexOf("?") < 0


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrea

unread,
May 17, 2019, 6:27:34 PM5/17/19
to Google Apps Script Community
Your help is superb.
Thanks to you I can get the list of users.
I did a quick test and it seems to work.
The only thing that 'strange' is that the maxResult parameter does not seem to be considered. I tried with the values 10 ... 50 ..... 100 .... 500
but in Logger.log I always get 21 results.
I hope it's a viewing limit.
Now I'm too tired to do more tests ..... it's midnight .... it's time to sleep :)

I do not know how to thank you !

I wish you a good continuation of the day
Andrea
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Andrea

unread,
May 20, 2019, 8:42:40 AM5/20/19
to Google Apps Script Community
Ciao Reno,
I want to thank you for the help you gave me.
I really appreciate it !
You are my personal hero :)

Best regards
Andrea
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Reno Blair
Educational Technology Services​


IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.

Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages