$IP ='30.0.0.252';
($name, $Alias, $Adresstyp, $Laenge, @Adressenfeld) =
                             gethostbyaddr(pack('C4', split('\.', $IP)), 2);
print "Name des Rechners:\t$name\n";
print "Alias zu $Name:\t $Alias\n";
print "Adresse zu $Name:\t ", join('.', unpack('C4', $Adressenfeld[0])),
"\n";
print "Adresstyp zu $Name:\t $Adresstyp\n";
print "Länge zu $Name:\t $Laenge\n";

Manfred

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 14. Oktober 2005 15:40
An: Ramlakhan,Dave; [EMAIL PROTECTED]
Cc: Perl-Win32-Admin@listserv.ActiveState.com
Betreff: RE: Remote User


That is a lot shorted than the code I was using.  Thanks!

Is there a way to determine the name of a machine via the IP address
without using nslookup?

- Adam 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Ramlakhan, Dave
Sent: Friday, October 14, 2005 3:59 AM
To: '[EMAIL PROTECTED]'
Cc: 'Perl-Win32-Admin@listserv.ActiveState.com'
Subject: RE: Remote User

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 13 October 2005 21:53
> To: Perl-Win32-Admin@listserv.ActiveState.com
> Subject: Re: Remote User
> 
> 
> Adam Stern <[EMAIL PROTECTED]> wrote:
> >Is there a way to tell who is currently logged into another
> workstation on
> the network via perl?
> 
> Have perl call and parse the output of nbtstat.

If you're using perl 5.6 you can try Win32::Message to get the nbtstat
message names, otherwise try Win32::NetAdmin

#####BEGIN
use Win32::NetAdmin;

my $server = "rfh-infoflex";
my %userRef;

if (Win32::NetAdmin::LoggedOnUsers($server,\%userRef)) {
        for my $user (sort keys %userRef) {
                print "$user is " . $userRef{$user} . "\n";
        }
}
#######END

unfortunately you appear to get all logged on users, including batch and
service accounts _______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to