This snippet shows you how to list WordPress users by role=administrator

 

$users = get_users('blog_id=1&orderby=nicename&role=administrator');

foreach ($users as $user) {
echo '<li>' . $user->user_login . ' | ' . $user->user_email . ' | ID: ' . $user->ID . '</li>';
}

Result

admin | youradminaccount@test.com | ID: 1
admin2 | youradminaccount2@test.com | ID: 2

Disclaimer: The content in this post is for educational purposes only. Always remember to take a backup before doing any of the suggested steps just to be on the safe side.
Referral Note: When you purchase through a referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer