TieRegistry with IPConfig

TieRegistry with IPConfig

am 02.04.2008 04:17:02 von Cosmic Cruizer

I'm trying to remotely look at the NIC cards on W2K3 servers that I have
admin accounts on. When I run the following it gives me an error:

use strict;
use Win32::IPConfig;

my $ipconfig;
my $host = "some IP address"; # Changed the IP address for posting
$ipconfig = Win32::IPConfig->new($host); # This is where it fails when
ran with admin account.
print "hostname=", $ipconfig->get_hostname, "\n"; # This is where it
fails when ran without admin account.

This happens with admin account
C:\NIC>nic.pl
Can't use an undefined value as an ARRAY reference at
C:/Perl/site/lib/Win32/TieRegistry.pm line 720.

This happens without using admin account (It's not first getting
Win32::IPConfig->new($host))
C:\NIC>nic.pl
Can't call method "get_hostname" on an undefined value at C:\\NIC\nic1.pl
line 7.

Any suggestions on what I need to do to fix this problem?

Is it failing because TieRegistry.pm is not able to get the registry
settings for the NIC?

(I have not been having luck with anything I've tried to do to get the
NIC info from remote servers.)