title: How to enable RDP 8.0 (From Group Policy) in windows 7 by scripting (e.g. vbScript)
body: <p>Recently I have installed two windows updates <code>KB2574819</code> and <code>KB2592687</code> for <code>RDP 8.0</code> in my 32 bit windows 7 service pack 1 PC for Remote Desktop Login. To enable the RDP 8.0 I have to enable it from the Group Policy. For this I have to run the gpedit.msc then go to the path</p>
  
  <p><strong>Computer Configuration-> Administrative Templates-> Windows Components-> Remote Desktop Services-> Remote Desktop Session Host-> Remote Session Environment->Enable Remote Desktop Protocol 8.0.</strong> and also Set <strong>Compression Algorithm to RDP Data</strong> to <strong>"Optimized to use less Network Bandwidth"</strong></p>
  
  <p>If I change the Group Policy manually It works perfectly OK. But I need to do this part using a script and for doing this I am passing hard time. After Googling for two days I came to this  conclusion that when I Enable the RDP 8.0 from Group Policy it affects two things,
          1. Registry
          2. "C:\Windows\System32\GroupPolicy\Machine\Registry.pol".</p>
  
  <p><strong>Registry:</strong> By using the ProcMon Software I found that the change in the registry is made in the following path</p>
  
  <pre><code>"HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{BE9DF25D-98DB-44BA-844D-20120DDC758D}Machine\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\fServerEnableRDP8"
  </code></pre>
  
  <p>That means If I set value 1 to fServerEnableRDP8, it will work. But the Problem is that in the path, <code>"{BE9DF25D-98DB-44BA-844D-20120DDC758D}"</code> Changes per machine even per installation of the updates. That's why after installing the updates I cannot directly set the value to registry.</p>
  
  <p><strong>Registry.pol:</strong> I manually enabled the RDP 8.0 in my PC. Then in the target PC I replaced it's Registry.pol file with mine. The gpedit.msc shows that RDP 8.0 is enabled but during remote session it does not use the RDP 8.0 (The Network sign was not there on the top bar, it's the RDP 8.0 indicator). The reason behind it that when I replaced the Registry.pol file and ran the command "gpupdate /force" it created a new path in the Registry. When I again enabled manually from the gpedit.msc it created another path. Mainly the numeric values (e.g. <code>{BE9DF25D-98DB-44BA-844D-20120DDC758D}</code>) changes in the path and windows follows the path in the registry what gpedit.msc created.</p>
  
  <p>I found about the Group Policy Object but i did not find much or proper documentation about it.</p>
  
  <p>So my question is</p>
  
  <ol>
  <li>How to do it by scripting? Can you provide some script or example? Please explain your answer.</li>
  <li>Can you provide some good tutorials on Scripting Group Policy Object like step by step introduction or something like that?</li>
  </ol>
  
  <p>Thanks in Advance. </p>