I swear I've seen this been asked before, but can't find the post for the life of me.

Is there a way to automate taking an image from a machine? or from a script?

In an ideal world, just using something like the MAC address to identify the machine, and set it to take an image on next boot.