Home > Archive > PERL Beginners > November 2006 > Win32::TieRegistry->Connect - How to specify credentials on remote machine?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Win32::TieRegistry->Connect - How to specify credentials on remote machine?
|
|
| Jonathan 2006-11-27, 6:57 pm |
| I'm trying to read registry information from a remote Windows PC, which
I have working when the remote PC has a user account with the same
login information as that of the PC trying to do the read. However, if
the remote machine doesn't have such a user account, then I get a "The
system could not find the environment option that was entered" error
message.
Is there a way to specify the user information for the remote machine
in conjunction with TieRegistry? Or, is there some other work around?
I'm using v5.8.8 built for MSWin32-x86-multi-thread on an XP SP2
machine. I've verified that just changing the password on the remote
machine is enough to make this succeed or fail. Here are the relevant
lines from the code:
my $Registry;
use Win32::TieRegistry 0.24 (
TiedRef => \$Registry, Delimiter => "/", ArrayValues => 1,
SplitMultis => 1, AllowLoad => 1,
qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ KEY_READ
KEY_WRITE KEY_ALL_ACCESS ),
);
my $regKeyName =
"HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall";
my $remKey= $Registry->Connect( $pc, $regKeyName, {
Access=>Win32::TieRegistry::KEY_READ() } )
or Carp::croak("!! Couldn't connect to $pc or can't open reg key
($regKeyName):\n$^E\n");
Thanks,
Jonathan
| |
| Jonathan 2006-11-30, 6:57 pm |
| Well, this appears to be tied to having had Remote Desktop disabled in
Windows Firewall. I guess I will email the module author for further
details.
Jonathan wrote:
> I'm trying to read registry information from a remote Windows PC, which
> I have working when the remote PC has a user account with the same
> login information as that of the PC trying to do the read. However, if
> the remote machine doesn't have such a user account, then I get a "The
> system could not find the environment option that was entered" error
> message.
>
> Is there a way to specify the user information for the remote machine
> in conjunction with TieRegistry? Or, is there some other work around?
>
> I'm using v5.8.8 built for MSWin32-x86-multi-thread on an XP SP2
> machine. I've verified that just changing the password on the remote
> machine is enough to make this succeed or fail. Here are the relevant
> lines from the code:
>
> my $Registry;
> use Win32::TieRegistry 0.24 (
> TiedRef => \$Registry, Delimiter => "/", ArrayValues => 1,
> SplitMultis => 1, AllowLoad => 1,
> qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ KEY_READ
> KEY_WRITE KEY_ALL_ACCESS ),
> );
>
> my $regKeyName =
> "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall";
> my $remKey= $Registry->Connect( $pc, $regKeyName, {
> Access=>Win32::TieRegistry::KEY_READ() } )
> or Carp::croak("!! Couldn't connect to $pc or can't open reg key
> ($regKeyName):\n$^E\n");
>
> Thanks,
> Jonathan
|
|
|
|
|