in reply to Re: Win32::OLE lookup registry value on remote machine via WMI
in thread Win32::OLE lookup registry value on remote machine via WMI

I only posted this sub with the modules I was using for reference, I am using it later in my script but I didn't want to post 300 lines of code.

I did try using eval

eval{$refRegistry->GetStringValue($HKEY_LOCAL_MACHINE, $newPath,$strVa +lueName, $value);}; print $@ if $@;

But I still don't get any output :(

I do have credentials to log into the machine because if the path to the registry value exists the sub works and returns a value. Also, if I don't call this sub the script works, I am also dumping services via WMI and that works

if (my $oWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\r +oot\\CIMV2") or warn "Unable to open $computer\n" && next OUTER){ .. +do stuff ..} if(my $colItems = $oWMIService->ExecQuery ( "Select * from Win32_Servi +ce")) {..do stuff..}

There really isint much info about using WMI in Perl out there and I appreciate your suggestions.

-Matt