Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

obtaining computer names from network 1

Status
Not open for further replies.

vindi

Programmer
Dec 2, 2002
10
US
I am trying to use Perl to create a list of all the computers that are one the network. Is there any function available that I can use?
Thanks.
 
Vindi,

Hi -- If you mean a Windows network, have a look at the standard module:

Win32::NetResource

Mike

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
i use the LanMan module NetServerEnum function ( Win32::Lanman::NetServerEnum ).

Win32::Lanman::NetServerEnum( '', $domain, SV_TYPE_WORKSTATION, \@W1);

foreach (@W1)
{
push( @WS, ${$_}{'name'});
}

foreach (@WS)
{
print "Found : $_\n";
}

i've used it to return an array of Windows boxes, and then pulled user names off of those using the Win32::NetAdmin::LoggedOnUsers

Alex

--

(space ghost and moltar are standing next to a huge ray gun)

space ghost : "moltar, i have a giant brain that is able to reduce any complex machine into a simple yes or no answer"
moltar : "okay, but that's not the CD burner"
space ghost : "moltar!. . . . . .yes!"

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top