Hi there, I need help listing the licenses consumed for an organization in our enterprise. Our enterprise has multiple organizations, and when I see the licenses consumed under Settings -> Enterprise Licenses, I see GitHub lists all the licenses for all the organizations. Is there a better way to separate or list the licenses consumed for each organization individually under the enterprise? Please suggest.
@nmattamGitHub, Enterprise accounts license unique users within the enterprise rather than users within an organization. If it did the latter and a user existed in more than one organization the number of licenses and costs would increase greatly.
So getting the list of members of your enterprise is correct.
You can query users and all organizations they are a member of, but for reasons noted above you cannot attribute a user license to a specific organization (unless a user is a member of a single organization only)
Thanks @byrneh for the details, it makes sense. Just in case a user is a member of a single organization what is the best way we can query the licenses consumed for the organization. Is it just GitHub interface that provides the details or are there any better approaches to it?
One reason for viewing the licenses at Org level is, we may want to restrict license usage, for example If Org A is allotted 20 licenses and Org B 50 licenses, Org A should only be utilizing its available 20 licenses and not from Org B if any additional licenses are required by Org A. Hence the ask. Sorry for being ignorant.
@nmattamGitHub, you have nt actually mentioned whether you are referring to enterprise server (on premise) or Enterprise Cloud (sitting on github.com).
You can query the members of an organization using GitHub’s rest REST API v3 or GraphQL API v4. AS already stated a unique under and enterprise account will be one license, so if a user is a member of more than one organization only one enterprise user licenses is consumed.
Here is an example of a rest api
If you run into problems using API and querying the data you need, it would be best to cerate a new question in the relevant topic.
You can mark this as solved if your question is now answered.