I'm in the process of setting up a PXE boot image such that if needed I can PXE boot a computer and it will automatically do the reimage. Using tftp it is fairly easy to set it up so that it uses the correct image for a given lab based on the mac address of the computer.
My problem: There is a mandatory scheme to be used for computer naming, and I would like to set it up so that after ghosting a computer, the correct computer name is automatically set. This name is based on the computers inventory number, so it is not something that can be generated.
I do have a table in a MySQL server which links hardware (MAC) addresses to their proper computer names. Thus my first thought was to write a script that connects to the SQL server, and does a simple query such as "SELECT hostname FROM mac_hostname WHERE mac_address='blah';", sets the hostname using the newsid utility from sysinternals, and then modifies a flag in the registry that essentially tells the script to bypass this whole procedure on future boots.
Does anybody else do anything similar or have any other suggestions on how I might implement this functionality?