<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - Remote Registry EnumKey via WMI and Perl - Comments</title>
 <link>http://community.activestate.com/forum-topic/remote-registry-enumkey-wmi-and-perl</link>
 <description>Comments for &quot;Remote Registry EnumKey via WMI and Perl&quot;</description>
 <language>en</language>
<item>
 <title>Remote Registry EnumKey via WMI and Perl</title>
 <link>http://community.activestate.com/forum-topic/remote-registry-enumkey-wmi-and-perl</link>
 <description>&lt;p&gt;I have been pounding my head against the wall to get perl to pull info from a remote registry using the WMI.  I have to stick with the WMI instead of just using Win32::OLE because I need to be able to use credentials other than the user&#039;s current login credentials.  Specifically if the user is running the script from a system not part of the AD Domain.&lt;/p&gt;
&lt;p&gt;Anywho I am trying to enumerate registry subkeys.  I have looked at a lot of sample code such as this code from &lt;a href=&quot;http://www.activexperts.com&quot; title=&quot;www.activexperts.com&quot;&gt;www.activexperts.com&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;Const HKEY_LOCAL_MACHINE = &amp;amp;H80000002

strComputer = &quot;.&quot;
 
Set oReg=GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; &amp;amp; _ 
    strComputer &amp;amp; &quot;\root\default:StdRegProv&quot;)
 
strKeyPath = &quot;SYSTEM\CurrentControlSet\Services&quot;
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
 
For Each subkey In arrSubKeys
    Wscript.Echo subkey
Next&lt;/pre&gt;&lt;p&gt;
the problem for me lies in the line oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys&lt;/p&gt;
&lt;p&gt;
it seems to be that it is declaring arrSubKeys from the Method EnumKey which it stuff all of the subkeys in as an array.  I don&#039;t know how to emulate this and get it to populate the variable in Perl.  If somebody could write a similar script in perl that work as an example for me I would be most appreciative.&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/remote-registry-enumkey-wmi-and-perl#comments</comments>
 <category domain="http://community.activestate.com/forums/perl-discussion-0">Perl discussion</category>
 <category domain="http://community.activestate.com/os/windows">Windows</category>
 <pubDate>Mon, 26 Nov 2007 16:54:15 -0800</pubDate>
 <dc:creator>jcluff</dc:creator>
 <guid isPermaLink="false">1669 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
