How to add users to a local computer group using command line

If you are wanting to add users to to a local computer group on a Windows machine, for example if you want to add users to local administrators group, you can do it through either group policy or running a command.

Sometimes, Active Directory environment is not available to do this. In that case, you can use the following command from a command line or through a batch file to add "All users" to the "Local adminsitrators" group

net localgroup Administrators "domain\Local_admins" /add