title: Read HKEY_USERS and HKEY_CURRENT_USERS
body: <pre><code>$strIPAddrTmp = "172.28.27.200"
  $strKeyIEConnections = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\"
  $strRegType = [Microsoft.Win32.RegistryHive]::CurrentUser
  $strRegKey  = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($strRegType, $strIPAddrTmp)
  $strRegKey  = $strRegKey.OpenSubKey($strKeyIEConnections)
  </code></pre>
  
  <p>I used the PS script above to try to read the contents of:</p>
  
  <pre><code>HKCU::Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings
  </code></pre>
  
  <p>I was just trying to check the IE proxy settings of a target remote machine.
  I found out that the script always returns the contents from <code>HKEY_USERS</code> instead of <code>HKEY_CURRENT_USERS</code>.
  What did I did wrong?</p>