In a cluster without DRS enabled, user should manually migrate the virtual machines off a host to let the host enter Maintenance Mode.
This sample script can automate this process and let the hosts enter Maintenance Mode one by one. After Maintenance, the script can migrated the virtual machines to make them balanced and evenly distributed in the cluster.