User:SVG/Maintenance scripts/removeRedundantUserGroup.php

This maintenance script can be executed in commandline. It allows removing an user group from members of another group or just removing all members from this group. The actions will be logged in user rights log (Special:Log/rights). This script is general usable.

php removeRedundantUserGroup.php > -u "User who is logged in rights log as executive user" > -g "Group that should be removed" > -m "Just remove group -g from members of this group (-m). Leave it empty if you want to remove all members from group -g" > -r "Reason that is shown in rights log. Leave it empty if you don't want to reasoning your action"

It could look like: cd /var/www/wiki/w/maintenance php removeRedundantUserGroup.php -u "Maintenance script" -g patroller -m sysop -r "rights already included in administrator"