If you're going to install a new (or used) motherboard make sure you get one with six memory slots, not 4. The newer version ("Revision 1") motherboards can run the older processors, and the newer ones that can only run on the updated 6-slot motherboard.
You can see the two version's HP Parts number if you google "Z400 spare parts".... this is the one you want, with the later part number:
System board (motherboard) - Intel Tylersburg-C2 1S/DDR3, 1333 MHz front side bus, six DIMM memory slots, and one IEEE-1394a (Firewire) port | 586968-001 |
Key info is that each HP part has two numbers.... the above is one of the two for that exact same motherboard, and you can search for that" on eBay to find the second. Or, just look and make sure you have a 6-sloter. It is quite easy to do a motherboard transplant. There is a new BIOS for that as of 4/16, by the way. Make sure to install that too.
You can read up in this forum about "Z400 boot block date" to see more about the differences. That "Revision 1" (second version) Z400 is still an excellent single processor workstation, and still has quite a bit of headroom if you feed it more memory and a fast processor. For memory these days 6 2GB sticks of proper HP memory used off eBay is inexpensive, and throw in a SATA generation II SSD such as the Intel 320 series 300GB, and you'll be very happy.