Custom function to find machine name