Admin SDK Enterprise License Manager 서비스를 사용하면 Apps Script에서 Admin SDK Enterprise License Manager API를 사용할 수 있습니다. 이 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);}}
사용자의 라이선스 할당 삽입
이 샘플은 지정된 제품 ID 및 SKU ID 조합에 대해 사용자의 라이선스 할당을 삽입하는 방법을 보여줍니다.
/** * 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);}}
[[["이해하기 쉬움","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"]],["최종 업데이트: 2024-12-21(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."]]],[]]