To retrieve serial number of the computer run the following command from command line
wmic bios get serialnumber
To retrieve model name of the computer run the following command from command line
wmic csproduct get name
This code doesn’t return information for all computers, but I’ve found it very usefull where its available.