Hi LucD,
Thank you for the quick response and the code. I see now it is not giving any errors and providing a result but not as expected.
Our device is a Nutanix Box and it has Dell nodes in it. So the code returns the serial number of the Nutnaix box where the output is same for all 4 servers in it.