Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
Script to transfer user data to (for example, a md@org.com) after deleting a user account from G Suite Admin SDK

I'm trying to develop a google script to transfer user data to (for example, a md@org.com), after deleting a user account from G Suite Admin SDK. I've tried and am unable to find it anywhere the script to transfer user data after google mail deletion. enter image description here

function onFormSubmit(e) {
 deleteUsers(e);
}
function deleteUsers() {
  var ss = SpreadsheetApp.openById('1Z0cNwh2BJLrq1bMQS3eU1tWLrjz2DLUne8CY3rMM7OE');
  var sheet = ss.getSheetByName('Delete Users');
  var data = sheet.getDataRange().getValues();

  var len = data.length;

  for(var i=1; i<len; i++){
    var user = data[i][0];
    var transferToEmail = data["Transfer to Email"][1];
    Logger.log(user);

    //use try catch in case a user is already removed
    try{
      AdminDirectory.Users.remove(user);
    }
    catch(err){}
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Some Google APIs are integrated with Google Apps Script as advanced services, unfortunately the Data Transfer API isn't, that is why on How to execute Data Transfer API? are using UrlFetchApp to make a HTTP request to call the Data Transfer API instead of something like AdminDirectory to call the Directory API / Reports API.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda