RegistryKey.GetValue on Remote Machines with XP and Windows 7 C#
<p>I am writing a script for my company that reaches out to every station located in certain Active Directory OU's.  The script then looks for a range of Microsoft Office registry values to see if the station has Office installed.  I say a range because we use multiple versions of office in the Enterprise and each come with a unique registry key.  The script then determines if the remote station has office installed and returns the DisplayName and DisplayVersion for further processing.  The script works perfectly on all Windows XP machines, however does not work on ANY Windows 7 machine in our enterprise.  Initially the script was having issues hitting the remote registries because Remote Registry was turned off on Windows 7 machines.  We fixed that through Group Policy and I am not able to hit the machines registries, however all of them return as not being installed.  The reason for this appears to be because the remote Windows 7 registries are returning a null value so the script assumes Office is not installed.  </p>

<pre><code>//open remote registry
RegistryKey office2003Exists = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, remoteComputer).OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{90120409-6000-11D3-8CFE-0150048383C9}");

RegistryKey office2007Exists = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, remoteComputer).OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{90120000-0012-0000-0000-0000000FF1CE}");

RegistryKey office2010Exists = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, remoteComputer).OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{90140000-0011-0000-1000-0000000FF1CE}");
</code></pre>

<p>I then check the results of that and write to a file as necessary based on what was returned.  Each line of code represents a different version of Office that could be installed throughout the company.  The only one that I have issues with is the last, which is Office 2010 Professional and can only be installed on Windows 7 x64 machines.  Does anyone have any thoughts on why the remote registry of the Windows 7 machines only would return null, while the XP machines function correctly.  </p>

<p>I have found other solutions that suggest checking the Wow6432Node but the uninstall keys are not located within the comparable location.  They are only listed in the 32 bit side of the registry.  Thoughts?</p>
