welcome to the forum.
What you mean by programaticaly? With script, Java or soemthing different?
If it work for standalone the commend will be the same execpt that you have to specify the server-group
I use Java to control the domain controller. I want create an application which take in parameter a custom package (zip file) with inside a deployment descriptor (For one or many server group, create datasource, add property, install theses modules, deploy this application,...) .
My tool explode the package, read the descriptor and install it. It's easy to deliver in production.
I am looking for a solution to "upload" the modules contained in package to each server only with Java api.