You'd probably be better off connecting through HKEY_USERS and foreaching
through the SIDs.

HKEY_CURRENT_USER is a derived key for the currently logged-in user.  I
would imagine it works locally, but connecting remotely (I would think) is a
different story.

So, in the case of:
  -one locally logged-in user,
  -2 terminal server users,
  -and 3 service accounts,
  
technically there are 6 places that could be called HKEY_CURRENT_USER, and
thus the problem in connecting to a remote HKCU rears it's ugly head.

Hope this helps,
Steven

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, August 11, 2002 2:21 PM
To: [EMAIL PROTECTED]
Subject: HKCU and Remote Registry Connection


I am trying to connect up to a machine remotely and pull some information
from the currently logged in user, if there is one.  Every time I connect up
though, I get only the keys from HKU\.DEFAULT.  Does anyone know how to get
it from the currently logged in user?

I must mention that I have tried both Win32::Registry and
Win32::TieRegistry, and both have had the same problem.  An example code for
TieRegistry is listed below.

-----[Start]----

use Win32::TieRegistry(Delimiter => "/");

$machine = "SN23TCH20";

$regkey = $Registry -> {"//$machine/HKEY_CURRENT_USER/Volatile
Environment"}  ||  die "ahhh";

foreach $key (sort keys %{$regkey}){
        print "$key\n\t\t${$regkey}{$key}\n";
}

-----[End]-----

This should dump all the environment settings for the user, but instead it
is only giving me the one environment setting for .DEFAULT.

Any help would be greatly appreciated.

Thanks.

Len.


_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to