As posted here: http://communities.vmware.com/message/1084212#1084212. This script is pretty self explanatory, edit the values at the top of the script to match your environment. This script must be run on the ESXi host.
Self-explanatory? What a LOAD of nonsense. I work for the DoD and create MANY scripts for performing various tasks on mulitple UNIX envs. If I wrote something like this WITHOUT having ALOT more commentary, it would be immediately rejected and I'd be updating my resume. This script looks like something a "BASIC" programmer would create.
Apparently, "someone" believes in "documentation-lite"...