Glad it worked,
The main issues with reliably retrieving the serial number are:
- vCenter only caches the serial number in the inventory database ( hence sometimes it is not returned )
- Accessing the host serial number via CIM can return the chassis serial number as well...
If it were held in the vCenter DB things would be easier...