Try this:
require 'win32ole'
HKLM = 0x80000002
computer = "machine1"
locator = WIN32OLE.new("WbemScripting.SWbemLocator")
svc =
locator.ConnectServer(computer,"root\\default","user","password",nil,nil,nil,nil)
reg = svc.Get("StdRegProv")
in_params = reg.Methods_("EnumKey").inParameters.SpawnInstance_()
in_params["hDefKey"] = HKLM
in_params["sSubKeyName"] =
'Software\Microsoft\Windows\Currentversion\Uninstall'
out_params = reg.ExecMethod_("EnumKey",in_params)
out_params.sNames.each { |key_name| puts key_name }
David dave wrote:
> Thank you for the reply. Is there another way to reach a remote
> registry and use impersonation? I am not sure how to login under a
> different user given your example.
> dave
>
> --
> Posted via http://www.ruby-forum.com/.