Note: if you are running CloudGraph locally you can view the interactive, automatically generated documentation in either GraphQL Playground or Altair by clicking the docs button on the right-hand side of the screen. After reading the below information we highly suggest you use one of these tools to test your queries as they will autocomplete fields for you and let you know if your queries are valid before you even submit them.
You can currently query the following attributes and connections on an Azure AD User
query {
queryazureADUser{
id
deletedDateTime
accountEnabled
ageGroup
city
companyName
country
createdDateTime
creationType
department
displayName
employeeHireDate
employeeId
employeeType
externalUserState
externalUserStateChangeDateTime
givenName
isResourceAccount
lastPasswordChangeDateTime
mail
mailNickname
officeLocation
onPremisesDistinguishedName
onPremisesDomainName
onPremisesImmutableId
onPremisesLastSyncDateTime
onPremisesSyncEnabled
onPremisesUserPrincipalName
otherMails
passwordPolicies
preferredLanguage
proxyAddresses
state
surname
usageLocation
userPrincipalName
userType
preferredName
responsibilities
appOwnerOf{
id
}
appRoleAssignments{
id
}
authRoleAssignments{
id
}
}
}
Get data for a single Azure AD User key that you know the ID for:
query {
getazureADUser(id: "12345") {
id
}
}
Get data for all of the AD Users with an enabled account across all accounts:
query {
queryazureADUser(filter: { accountEnabled: { eq: true } }) {
id
}
}
Get data for all of the AD Users that are connected to an appRoleAssignment:
query {
queryazureADUser(filter: { has: appRoleAssignments }) {
id
}
}
You can order the results you get back either asc or desc depending on your preference:
query {
queryazureADUser(order: { desc: surname }) {
id
}
}
Only select and return the first two AD Users that are found:
query {
queryazureADUser(first: 2, order: { desc: displayName }) {
id
}
}
Only select and return the first two AD Users that are found, but offset by one so keys two & three are returned:
query {
queryazureADUser(first: 2, order: { desc: displayName }, offset: 1) {
id
}
}
Count the number of AD Users across all scanned Azure subscriptions:
query {
aggregateazureADUser {
count
}
}
Count the number of AD Users with enabled accounts. Note that you can apply all of the same filters that are listed above to aggregate queries:
query {
aggregateazureADUser(filter: { accountEnabled: true }) {
count
}
}
Find all of the AD Users that are in the management department across all your accounts:
query {
queryazureADUser(filter: { department: { eq: "management" } }) {
id
}
}
Putting it all together; get all data for all AD Users across all regions for all scanned Azure subscriptions in a single query. For the purposes of this example, we will only get direct children of the keys but if you want to it's easy to go from say, disk -> virtualMachine -> networkInterface ...etc:
query {
queryazureADUser{
id
deletedDateTime
accountEnabled
ageGroup
city
companyName
country
createdDateTime
creationType
department
displayName
employeeHireDate
employeeId
employeeType
externalUserState
externalUserStateChangeDateTime
givenName
isResourceAccount
lastPasswordChangeDateTime
mail
mailNickname
officeLocation
onPremisesDistinguishedName
onPremisesDomainName
onPremisesImmutableId
onPremisesLastSyncDateTime
onPremisesSyncEnabled
onPremisesUserPrincipalName
otherMails
passwordPolicies
preferredLanguage
proxyAddresses
state
surname
usageLocation
userPrincipalName
userType
preferredName
responsibilities
appOwnerOf{
id
}
appRoleAssignments{
id
}
authRoleAssignments{
id
}
}
}