How to remotely stop/start Admin and Managed Servers of a Weblogic Domain using WLST ?

If we need  to do administration of a whole weblogic doman and all of its servers, we can WLST, yes we know using the Administration Console it makes things much simpler and  easier but this  is helpful in scenarios where  the console is restricted plus I personally like using WLST hence this post.. :-)
Using WLST one can monitor and manage the entire domain using node manager.

To start the Admin Server using WLST ensure that the Admin Server is associated to a machine. 
Now we need   to get into the WLST prompt. 

How do we start the nodemanager using wlst ?  
Once in the WLST Prompt, Issue the command startNodeManager(), refer the screenshot for more details.


 Exiting the wlst prompt will not stop the nodemanager from running, it will be running irrespective of the wlst tool.

Use the below command to connect to the nodemanager :

nmConnect('username','password','adminserver url','port','domain name','domain path','nodemanager type')

where the above are arguments for the nmConnect() command


Use the below command to start the AdminServer using WLST :

nmStart('AdminServer')

Use the below command to check the status of the AdminServer, managed servers :

nmServerStatus('AdminServer')
nmServerStatus('ManagedServer')

Use the below command to stop or kill the servers:

nmKill('AdminServer')
 

We can  also start the managed servers remotely , to do that:;

On the remote machine  start the WLST and connect to the machine running AdminServer unsing connect()

Once connected, issue the below command from the remote machine:

nmEnroll('WL_HOME/common/nodemanager')


Now to start the managed servers from the remote machine, connect to the nodemanager using the nmConnect() command and issue nmStart('ManagedserverName') for the manager servers.