You could script that pretty easily to run on all domains (virtualmin list-domains --name-only can be used to put that list in a variable you can loop over), or a specific list of domains.
I don’t see how to use “create-admin” to do either thing?
The “Include domain names for extra admins” checkbox sets things so that even though I’ve made a domain’s admin “hostmaster”, the user has to type in “hostmaster@their-domain.com” for it to work.
If I have a “hostmaster” already as an Extra Admin on a domain that was created before I checked that box, even deleting the Extra Admin and creating it again (if I knew the password) wouldn’t do that (as I understand the logic) because this is a “Default settings for new domains”.
Somewhere a bit must be set at the time of domain creation that would cause new “Extra Admins” to be created as @their-domain.com in the background. I would like to set that bit for a domain that already exists, and if possible, update the pre-existing Extra Admins.
I’ll have to read the code to figure out how to make that happen, unless @Jamie knows off-hand how to make an existing domain give Extra Admins the fully qualified username…
Once that option is turned on, new extra admins created for all domains on the template will get the fully qualified name. And you could rename an existing extra admin to the user@domain format, or just delete and re-create it.
You can’t rename an extra admin after it’s created to use a different format. Format will stay the same. The only solution is to create a new one. Or, edit the config files manually.
Actually I checked and this is possible. You can use the virtualmin modify-admin command with the --append and --append flags to rename to a different username and then back again.