turbot/azure_insights

Query: activedirectory_user_with_custom_role_count

Usage

powerpipe query azure_insights.query.activedirectory_user_with_custom_role_count

SQL

select
count(distinct u.display_name) as value,
'With Custom Role' as label
from
azuread_user as u
left join azure_role_assignment as a on a.principal_id = u.id
left join azure_role_definition as d on d.id = a.role_definition_id
where
d.role_type = 'CustomRole'
and u.account_enabled;

Dashboards

The query is used in the dashboards: