2 Replies Latest reply on May 25, 2017 4:21 AM by rstoker13

    Retrieve Windows registry values using vRO

    rstoker13 Enthusiast
    VMware Employees

      I attempted to search the forum assuming someone had asked this question already, but was unable to find anything. I apologize if this is a duplicate.


      I am trying to retrieve the value of "ComputerId" under hklm\software\wow6432node\bigfix\enterpriseclient\globaloptions on a Windows 2012R2 server. As you can tell from the Key path, this is a 32bit key. I have tried WOW32, WOW64 and WOWNative without success. I have attempted the code below, even going back to the root of HKLM and recursively listing all Keys. When doing this, ONLY 2 keys are displayed. It almost seems as though it is a permissions issue but I am using a local admin account. Perhaps elevation is needed? If so, how do I elevate using Guest Operations?



      var host = vm.sdkConnection;

      //var regex = "~/^ComputerId$/"



      var guestOperationsManager = host.guestOperationsManager;

      var guestAuth = new VcNamePasswordAuthentication();

      guestAuth.username = vmUsername;

      guestAuth.password = vmPassword;

      guestAuth.interactiveSession = true



      var guestRegKeySpec = new VcGuestRegKeyNameSpec()

      guestRegKeySpec.registryPath = "HKLM"

      guestRegKeySpec.wowBitness = regKeyWowSpec;



      var regMgr = guestOperationsManager.guestWindowsRegistryManager;

      var regKeyValues = regMgr.listRegistryKeysInGuest(vm , guestAuth , guestRegKeySpec , true , null)



      for each(regKeyValue in regKeyValues){