I want to know if we can pull out any data from the users in google workspace who don't have multi factor authentication, also can we pull anything from admin API in Google Workspace like the list of users or anything for the users without MFA?
I want to know if we can pull out any data from the users in google workspace who don't have multi factor authentication, also can we pull anything from admin API in Google Workspace like the list of users or anything for the users without MFA?
Yes it is possible. You can use the Directory API to do this with the users.list method and with a simple query checking the value from the isEnrolledIn2Sv parameter you can list all the users that have not set up MFA in their accounts.
As an example you can use the following script from Google Apps Script using the Directory API and the suggested methods:
function usersNotEnrolled() {
let request = {
"customer": "my_customer",
"query": "isEnrolledIn2Sv=false"
};
let userList = AdminDirectory.Users.list(request);
for(let i=0; i<userList.users.length; i++)
{
Logger.log(userList.users[i].primaryEmail);
}
}
References: