Programmatically add a user under MODX 3.x

Is there a standard procedure to do this?
And (if not) how do I get the encrypted password?

If you have CLI access, you could use teleport, GitHub - modxcms/teleport at 2.x.

You could use code like this one from an old forum post:

I think this should still work.

Maybe with MODX 3 you have to use the fully qualified class names (e.g. $modx->newObject('MODX\\Revolution\\modUser') instead of $modx->newObject('modUser')).

Many thnx. This works.