Apply "Defaults for new Domain" to existing domains

If I go to:

Virtualmin > System Settings > Virtualmin Configuration > Defaults for new domains

And set something, for example:

“Include domain names for extra admins”

That will cause an “Extra Admin” called “webmaster” to really be created as “webmaster@the-domain.com” (and require that at login).

Can I enact that on existing domains (created before that box was checked)?

Can I enact that on existing Extra Admins?

Thanks.

SYSTEM INFORMATION
OS type and version Ubuntu 24.04
Virtualmin version 7.50.0

Not in the GUI, at least not in bulk.

But, there is a create-admin command. create-admin | Virtualmin — Open Source Web Hosting Control Panel

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.

Thanks.

Oh, I misunderstood your question.

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…

Do you mean renaming the existing ones? I doubt it would ever be an option we support. I think the simplest solution is just to recreate them.

And, we should definitely display login names as they are; otherwise, it’s really confusing; fixed here.

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.

Hmm, maybe we should add support for that.

No, I don’t think we should. It’s an edge case. It’s not worth the complexity introduced.

1 Like

if it is such an “edge case” then all that is needed is a “how to do it” manually. :safety_pin:

They don’t need to know how to do it, I don’t think; just re-create extra admins again, otherwise we “solve a problem” and end up with two more.

1 Like

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.