diff --git a/graphql/queries/emu-list-scim-accounts.graphql b/graphql/queries/emu-list-scim-accounts.graphql new file mode 100644 index 000000000..3ac1e9f2f --- /dev/null +++ b/graphql/queries/emu-list-scim-accounts.graphql @@ -0,0 +1,32 @@ +# This GraphQL query can be used to generate a list of enterprise members and their SCIM account details in a GitHub Enterprise Cloud with Managed Users (EMU) enterprise account. +# +# Please ensure that your Personal Access Token (PAT) has the "read:enterprise" scope to access enterprise-level data. +# Replace `ENTEPRISE_SLUG` with the slug of your enterprise. To get more than 10 members, you can adjust the "first" parameter. +# +# Note: the output will include suspended users (identified with their obfuscated account name), but it will not include personal user accounts that are not part of the EMU (Enterprise Managed Users) system. + +query ListAllEnterpriseUsers { +# Replace `ENTERPRISE_SLUG` with the slug of your enterprise. To get more than 10 members, you can adjust the "first" parameter. +# +# Note: the output will include suspended users (identified with their obfuscated account name), but it will not include personal user accounts that are not part of the EMU (Enterprise Managed Users) system. + +query ListAllEnterpriseUsers { + enterprise(slug: "ENTERPRISE_SLUG") { + ownerInfo { + samlIdentityProvider { + externalIdentities(first: 10) { + nodes { + user { + login + name + } + scimIdentity { + username + groups + } + } + } + } + } + } +} diff --git a/graphql/queries/user-org-membership.graphql b/graphql/queries/user-org-membership.graphql new file mode 100644 index 000000000..2f6486510 --- /dev/null +++ b/graphql/queries/user-org-membership.graphql @@ -0,0 +1,15 @@ +# This GraphQL query can be used to generate a list of organizations a user belongs to on GitHub.com +# replace GITHUB_LOGIN with the username that you would like to view +# +# Note: the organizations listed are only ones that the calling user is a member of. If the calling member is not part of any organizations that the searched user belong to, it will not be shown here. + +query GetUserOrganizations { + user(login: "GITHUB_LOGIN") { + organizations(first: 100) { + nodes { + organization_name: name + organization_slug: login + } + } + } +}