I did just do a query, but would still be interested in knowing if there’s a more elegant way of doing it using occ etc
FYI, the query I used to get users with 2FA turned on is:
select json_extract(oc_accounts.data,'$.displayname.value') from oc_twofactor_totp_secrets join oc_accounts on oc_twofactor_totp_secrets.user_id=oc_accounts.uid;
“… more elegant …” is always depending on the point of view
You can e.g. try ./occ user:information <user> or ./occ twofactorauth:state <user> to get user settings displayed. Nevertheless you need to loop through the whole user list to get the desired information.