Can't export number of users within resold EDU domains

36 views
Skip to first unread message

Ivan Petrov

unread,
Jul 1, 2020, 11:29:28 AM7/1/20
to Google Apps Script Community
Hi guys,

After the G Suite reseller console was updated, the number of created users created in my resold EDU domains stopped showing up with the automatic export.

I checked with the support and they said behavior is expected and redirected me to the reseller API (https://developers.google.com/admin-sdk/reseller/v1/reference/subscriptions/list ) and of course said it's not supported.

I tried searching for all our subscriptions, but ran into a problem that brought me here - even in the API, when I check the information for a specific G Suite for Education domain, the number of users (licenses) within the domain is displayed as 0

"seats": { "kind": "subscriptions#seats", "licensedNumberOfSeats": 0

I also found a script to extract the information, but again, the number of seats for EDU users is not counted. Just in case, I'm pasting the script below. If anybody can suggest an addition or a different script, that would show the number of users within a G SUite for Education resold accounts, that would be wonderful.



function getSubscriptions() {
  var sheetActive = SpreadsheetApp.openById("1JW4JFcdd3xvSb2cZZvdQpGi9CC89adt9AidB123MMN4s");  // please enter Spreadsheet ID
  var ss = sheetActive.getSheetByName("Sheet1");  // please enter Spreadsheet tab name
  var result;
  var subscriptions;
  var pageToken;
  do {
    result = AdminReseller.Subscriptions.list({
      pageToken: pageToken
    });
    for (var i = 0; i < result.subscriptions.length; i++) {
      var subscription = result.subscriptions[i];
      var todays_date = new Date();
ss.appendRow([todays_date, subscription.customerDomain, subscription.skuName, subscription.seats.maximumNumberOfSeats,
 subscription.plan.planName,subscription.plan.isCommitmentPlan,subscription.seats.licensedNumberOfSeats,subscription.seats.numberOfSeats,subscription.trialSettings.isInTrial]);
      Logger.log(todays_date,
                 subscription.customerDomain, subscription.skuName,
                 subscription.plan.planName,subscription.plan.isCommitmentPlan,subscription.seats.licensedNumberOfSeats,subscription.seats.numberOfSeats,subscription.trialSettings.isInTrial);
    }
    pageToken = result.nextPageToken;
  } while (pageToken);
}



Kim Nilsson

unread,
Jul 4, 2020, 10:29:04 AM7/4/20
to Google Apps Script Community
For EDU domains you just need to count how many users there are, not licences.
Only if you have Enterprise for Education or Voice licences will you ever get any numbers when you count licences.
Reply all
Reply to author
Forward
0 new messages