use Win32::OLE ('in'); ... @host = ($server,"Root/default",$user,$password); $localWMI = Win32::OLE->new('WbemScripting.SWbemLocator'); $WMI = $localWMI->ConnectServer(@host); $registry = $WMI->Get("StdRegProv") or die "Failed to get registry."; $strPath='SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName'; $strValue = "ComputerName"; print $strPath; $return=$registry->GetStringValue( 2147483650, $strPath, $strValue, $result ); print "\n$strValue:($return,$result)\n"; my $err = Win32::OLE->LastError(); if ($err == 0) {print "Successful!\n";} else {print $err;}