title: How to get the data from a value from the registry using Powershell
body: <p>I have the following registry key value that I want to check via Powershell:</p>
  
  <p>"SERVER_NAME"</p>
  
  <p>HK_CLASSES_ROOT\AppID\{54C92AE1-77C3-11D1-9B6C-00A024BF0B6D}</p>
  
  <p>the value is "RemoteServerName" and the data from that value is a server that I need to check.</p>
  
  <p>Registry View:</p>
  
  <p>VALUE                     DATA</p>
  
  <hr>
  
  <p>(Default)                 WFM Tally Server
  RemoteServerName          DNVR-WFMTAL10</p>
  
  <p>So far I tried the following codes but all I get is the Valuename (RemoteServerName) or the data from the Default value (WFM Tally Server)</p>
  
  <p>Here they are:</p>
  
  <pre><code>foreach ($server in $server_list){
  $hklm = 2147483648
  $sSubKeyName = "AppID\\{54C92AE1-77C3-11D1-9B6C-00A024BF0B6D}"
  $sValueName = "WFM Tally Server"
  $wmi = [wmiclass]"Root\default:stdRegProv" 
  ($wmi.GetStringValue($hklm,$sSubKeyName)).sValue
  </code></pre>
  
  <p>and here is the other code:</p>
  
  <pre><code>foreach ($server in $server_list){
  $hklm = 2147483648
  $sSubKeyName = "AppID\\{54C92AE1-77C3-11D1-9B6C-00A024BF0B6D}"
  $sValueName = "WFM Tally Server"
  $wmi = [wmiclass]"Root\default:stdRegProv" 
  ($wmi.GetStringValue($hklm,$sSubKeyName)).sValue
  </code></pre>
  
  <p>What am I missing?</p>