User lists with multiple roles

In automation script, is there any script API method, where we can get a list of users having only two roles ("Everybody" and "Registered Users") and not having any other role. We don't want to loop through the entire user list for checking the individual roles?