TieRegistry with IPConfig

C

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top