Putting together a query/policy that detects accounts in the administrators group on Windows. Having some trouble getting the query to show me 'roaming' type accounts (i.e. AzureAD) that are in the Local Administrator group. Current query is as below but only shows me the local administrator group despite being able to see Azure groups/Azure AD members in there:
Can anyone help, please?
select username, u.uid, groupname,ug.gid, description, uuid
from users as u
join user_groups as ug
using(uid)
join groups
using(gid)
where type = 'local'
and groupname = 'Administrators'