Add number of members to “Right Now” dashboard widget

So here is the small snippet to show total number of users and all roles with user count. This code should go in the themes functions.php file.

The code uses count_user function to fetch the array and show it up on Right Now dashboard screen.

function wpse_60487_custom_right_now() {
    $users = count_users();
    echo '<table><tbody>';
    echo '<tr><td class="first b b_pages">'.$users['total_users'].'</td><td class="t pages"> total users</td></tr>';
    foreach($users['avail_roles'] as $role => $count)
    echo '<tr><td class="first b b_pages">'.$count.'</td><td class="t pages">'.$role.'</td></tr>';
    echo '</tbody></table>';

 }
add_action( 'wpse_60487_custom_right_now', 'dashboard_wps_user_count');