Yönetici SDK'sı Enterprise Lisans Yöneticisi Hizmeti
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Yönetici SDK'sı Enterprise License Manager hizmeti, Apps Script'te Yönetici SDK'sı Enterprise License Manager API'yi kullanmanıza olanak tanır. Bu API, alan yöneticilerinin kullanıcı lisanslarını atamasına, güncellemesine, almasına ve silmesine olanak tanır.
Referans
Bu hizmet hakkında ayrıntılı bilgi için Yönetici SDK'sı Enterprise License Manager API'nin referans dokümanlarına bakın. Apps Script'teki tüm gelişmiş hizmetler gibi Yönetici SDK'sı Enterprise Lisans Yöneticisi hizmeti de herkese açık API ile aynı nesneleri, yöntemleri ve parametreleri kullanır. Daha fazla bilgi için Metod imzaları nasıl belirlenir? başlıklı makaleyi inceleyin.
Aşağıdaki örnek kodda API'nin 1. sürümü kullanılmaktadır.
Alan için lisans atamalarının listesini alma
Bu örnek, alan adındaki kullanıcılar için ürün kimliği ve SKU kimliği dahil olmak üzere lisans atamalarını günlüğe kaydeder.
Sonuçların tam listesine erişmek için sayfa jetonlarının kullanıldığına dikkat edin.
/** * 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);}}
Kullanıcı için lisans atama ekleme
Bu örnekte, belirli bir ürün kimliği ve SKU kimliği kombinasyonu için bir kullanıcıya nasıl lisans atanacağını gösterilmektedir.
/** * 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);}}
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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."]]],[]]