I'm trying to read a registry value from a remote pc on my network...
$pc = "192.168.1.3";
$WbemLocator = new COM ("WbemScripting.SWbemLocator");
$WbemServices = $WbemLocator->ConnectServer($pc, 'root\\cimv2', 'username', 'password');
$WbemServices->Security_->ImpersonationLevel = 3;
$registry = $WbemServices->Get('StdRegProv');
define('HKEY_LOCAL_MACHINE', new VARIANT(0x80000002, VT_UI4));
$value = "";
$registry->getStringValue(HKEY_LOCAL_MACHINE, "SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Picasa 3", "DisplayName", $value);
var_dump($value);
PHP just gives me nothing... shouldn't it set '$value' to the appropriate value of the registry key? do I have to set '$value' to a particular kind of variable? I have to use a VARIANT when using EnumKey... I'm using PHP 7.2 on IIS with the com_dotnet extension enabled.
User contributions licensed under CC BY-SA 3.0