Manual:CheckUsernames.php

checkUsernames.php is a maintenance script located in the maintenance directory that is used to check that all usernames in the database (user table) are actually valid. Existing usernames can become invalid if User::isValidUserName is altered or if $wgMaxNameChars is changed.

Usage
php checkUsernames.php