שירות Admin SDK Enterprise License Manager
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
שירות Enterprise License Manager של Admin SDK מאפשר לכם להשתמש ב-Admin SDK Enterprise License Manager API ב-Google Apps Script. ממשק ה-API הזה מאפשר לאדמינים של דומיין להקצות, לעדכן, לאחזר ולמחוק רישיונות משתמשים.
מידע מפורט על השירות הזה זמין במאמרי העזרה בנושא Admin SDK Enterprise License Manager API. בדומה לכל השירותים המתקדמים ב-Apps Script, שירות Admin SDK Enterprise License Manager משתמש באותם אובייקטים, שיטות ופרמטרים כמו ממשק ה-API הציבורי. מידע נוסף זמין במאמר איך נקבעות חתימות של שיטות.
/** * 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,);}}
הוספת הקצאת רישיון למשתמש
בדוגמה הזו אפשר לראות איך להוסיף הקצאת רישיון למשתמש, עבור שילוב נתון של מזהה מוצר ומזהה 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("Failed with an error %s ",e.message);}}
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-05-05 (שעון UTC)."],[],[]]