Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Il servizio Enterprise License Manager dell'SDK Admin ti consente di utilizzare l'API Enterprise License Manager dell'SDK Admin in Apps Script. Questa API consente agli amministratori di dominio di assegnare, aggiornare, recuperare ed eliminare le licenze utente.
Riferimento
Per informazioni dettagliate su questo servizio, consulta la documentazione di riferimento per l'API Enterprise License Manager di SDK Admin. Come tutti i servizi avanzati di Apps Script, il servizio Enterprise License Manager dell'SDK Admin utilizza gli stessi oggetti, metodi e parametri dell'API pubblica. Per ulteriori informazioni, consulta Come vengono determinate le firme dei metodi.
Il codice di esempio riportato di seguito utilizza la versione 1
dell'API.
Visualizza un elenco di assegnazioni delle licenze per il dominio
Questo sample registra le assegnazioni delle licenze, inclusi l'ID prodotto e l'ID SKU, per gli utenti nel dominio.
Tieni presente l'utilizzo dei token pagina per accedere all'elenco completo dei risultati.
/** * Logs the license assignments, including the product ID and the sku ID, for * the users in the domain. Notice the use of page tokens to access the full * list of results. */functiongetLicenseAssignments(){constproductId='Google-Apps';constcustomerId='example.com';letassignments=[];letpageToken=null;do{constresponse=AdminLicenseManager.LicenseAssignments.listForProduct(productId,customerId,{maxResults:500,pageToken:pageToken});assignments=assignments.concat(response.items);pageToken=response.nextPageToken;}while(pageToken);// Print the productId and skuIdfor(constassignmentofassignments){console.log('userId:%s,productId:%s,skuId:%s',assignment.userId,assignment.productId,assignment.skuId);}}
Inserire un'assegnazione di licenza per un utente
Questo esempio mostra come inserire un'assegnazione della licenza per un utente, per una determinata combinazione di ID prodotto e ID SKU.
/** * Insert a license assignment for a user, for a given product ID and sku ID * combination. * For more details follow the link * https://developers.google.com/admin-sdk/licensing/reference/rest/v1/licenseAssignments/insert */functioninsertLicenseAssignment(){constproductId='Google-Apps';constskuId='Google-Vault';constuserId='marty@hoverboard.net';try{constresults=AdminLicenseManager.LicenseAssignments.insert({userId:userId},productId,skuId);console.log(results);}catch(e){// TODO (developer) - Handle exception.console.log('Failedwithanerror%s',e.message);}}
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-06-05 UTC."],[[["The Admin SDK Enterprise License Manager service enables domain admins to manage user licenses within Apps Script using the Admin SDK Enterprise License Manager API."],["It allows for assigning, updating, retrieving, and deleting user licenses for various products."],["This is an advanced service that requires enabling before use and utilizes the same structure as the public API."],["Provided sample code demonstrates how to retrieve and assign licenses using the API."]]],[]]