Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Layanan Enterprise License Manager Admin SDK memungkinkan Anda menggunakan
Admin SDK Enterprise License Manager API di
Apps Script. API ini memungkinkan admin domain menetapkan, memperbarui, mengambil, dan menghapus lisensi pengguna.
Referensi
Untuk mengetahui informasi selengkapnya tentang layanan ini, lihat
dokumentasi referensi untuk
Admin SDK Enterprise License Manager API. Seperti semua layanan lanjutan di Apps
Script, layanan Enterprise License Manager Admin SDK menggunakan objek,
metode, dan parameter yang sama dengan API publik. Untuk informasi selengkapnya, lihat Cara menentukan tanda tangan metode.
Contoh ini mencatat penetapan lisensi, termasuk ID produk dan
ID SKU, untuk pengguna di domain.
Perhatikan penggunaan token halaman untuk mengakses daftar lengkap hasil.
/** * 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);}}
Memasukkan penetapan lisensi untuk pengguna
Contoh ini menunjukkan cara menyisipkan penetapan lisensi untuk pengguna, untuk
kombinasi ID produk dan ID SKU tertentu.
/** * 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);}}
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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."]]],[]]