Skip to content

Commit 17d2a3a

Browse files
jusuchin85Copilot
andauthored
Add new GraphQL queries to list organization memberships for a user and list SCIM accounts for an EMU (#791)
* Add query to list organization memberships for a user * Add GraphQL query to list SCIM accounts for an EMU Co-authored-by: Copilot <[email protected]>
1 parent c13f458 commit 17d2a3a

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# 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.
2+
#
3+
# Please ensure that your Personal Access Token (PAT) has the "read:enterprise" scope to access enterprise-level data.
4+
# Replace `ENTEPRISE_SLUG` with the slug of your enterprise. To get more than 10 members, you can adjust the "first" parameter.
5+
#
6+
# 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.
7+
8+
query ListAllEnterpriseUsers {
9+
# Replace `ENTERPRISE_SLUG` with the slug of your enterprise. To get more than 10 members, you can adjust the "first" parameter.
10+
#
11+
# 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.
12+
13+
query ListAllEnterpriseUsers {
14+
enterprise(slug: "ENTERPRISE_SLUG") {
15+
ownerInfo {
16+
samlIdentityProvider {
17+
externalIdentities(first: 10) {
18+
nodes {
19+
user {
20+
login
21+
name
22+
}
23+
scimIdentity {
24+
username
25+
groups
26+
}
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This GraphQL query can be used to generate a list of organizations a user belongs to on GitHub.com
2+
# replace GITHUB_LOGIN with the username that you would like to view
3+
#
4+
# 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.
5+
6+
query GetUserOrganizations {
7+
user(login: "GITHUB_LOGIN") {
8+
organizations(first: 100) {
9+
nodes {
10+
organization_name: name
11+
organization_slug: login
12+
}
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)