Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Viewing network shares

by Mr. Muskrat (Canon)
on Feb 26, 2003 at 14:08 UTC ( #238770=note: print w/replies, xml ) Need Help??

in reply to Viewing network shares

Instead of hardcoding the computer names in the script, why not read in the lmhosts file?

Added from here down.

I looked at lmhosts.sam and found the following example: rhino #PRE #DOM:networking #net group's DC "appname \0x14" #special app serv +er popular #PRE #source server localsrv #PRE #needed for the i +nclude #BEGIN_ALTERNATE #INCLUDE \\localsrv\public\lmhosts #INCLUDE \\rhino\public\lmhosts #END_ALTERNATE

It would be easy to extract the names of the computers (the ones in other domains too) and also to read in the names from include files on other systems.

Replies are listed 'Best First'.
Re: Re: Viewing network shares
by Hyler (Sexton) on Feb 26, 2003 at 16:00 UTC

    As I wrote in the initial description, I did this to check a group of computers, not all "visible" computers on the network.

    I wrote this little thing to save me from manually having to browse the computers for shares. Learning about the topic and writing it took longer than it would have taken to manually check the computers. But next time I want to check some computers it's just a matter of seconds to alter and run it. The ARGV bit also makes it possible to simply run computer1 computer7 server_A laptopBOB
    Does anyone really use the LMHOSTS file? Maybe for small internal networks with few (Windows) computers, but otherwise I think it's better managed by a Domain Controller (and with DHCP/WINS). It would be better to ask the "Windows network" about its resources than to check a local file whose validity you can't be sure of.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://238770]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2021-10-17 03:06 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (71 votes). Check out past polls.