The way we ended up doing it is somewhat round about but works well for us.
We create clones from a standard template. We then run a script to change the hostname and computer name (you can do all the other changes and configurations at this point). We then reboot the clone and its a new machine. Then we use the ESX scripting to get the DNS nameof the computer, which is he hostname we just assigned to it and store the VMName and the Hostname into a database table... I can provide more details in a PM if needed.