Through the Operating System

Windows

Control Panel

It is convenient to setup one computer this way, but very cumbersome if you deal with a great number of computers.

Configure operating system environment by opening Control Panel > System window, then going to the Advanced or Advanced System Settings tab and clicking the Environment Variables button.

You can either create a user variable (active only when the current user is logged on), or a system variable (always active on this computer).
For a render farm, it is recommended to use system variables because render farm software sometime launch render using a different user account, or as a service (with the system account). But note that when using a System Variable, you will need to restart the computer so that it is taken into account.
When setting a variable on a user computer, it is enough to set it as User Variable, and you will only need to restart Maya so that it is taken into account.

How to choose between User and System variable on Windows?

If you are a USER and probably want to setup a node-locked license on your computer, choose to create a new USER variable. This way you will not have to restart your computer, but juste relaunch Maya again to take the new variable into account. If you are a SYSADMIN trying to setup variable at the computer level, you need to create a SYSTEM variable (in our example MAYA_MODULE_PATH for the plugin to be found automatically, but your variable may be called differently depending on what you are trying to do). For this variable to be taken into account, you need to restart the computer. 

You can check the begining of this video to see how to do that in practice, and maybe even create your own launcher script to be able to customize the way you launch your DCC software with Golaem

 

Group Policy

If you use Group Policy Objects (GPO) to administer your computers, you can simply add Environment Variable Items. The Environment Variables will then be automatically set on all applicable computers.

You can either create a user variable (active only when the current user is logged on), or a system variable (always active on this computer).
It is recommended to use system variables because render farm software sometime launch render using a different user account, or as a service (with the system account).

See Microsoft Help for more details: Configure an Environment Variable Item

NB: as all Active Directory action, it is not immediate, and you have to wait until Active Directory deploy the variable

Linux

Environment variables should be exported in one of your logon (~/.bashrc or ~/.bash_profile/ ...) or init script (depends on your distribution)

Here is an example how to set these variables