Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Accessing workgroup names using perl

by Hydro (Acolyte)
on Jun 19, 2002 at 17:29 UTC ( [id://175783]=perlquestion: print w/replies, xml ) Need Help??

Hydro has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to get a list of available workgroup names on a network using perl?

Jonathan

Replies are listed 'Best First'.
Re: Accessing workgroup names using perl
by vladb (Vicar) on Jun 19, 2002 at 18:05 UTC
    I'm not a huge expert on Windows NT, but couldn't you run the 'net' command from inside a perl script and simply process the output to get the desired result? Find some detailed info on the 'net' command: here.

    my @net_info = `net config`; # @net_info should contain lines of output # produced by the 'net config' command. # I hope they should contain work group info? while (@net_info) { # parse the line here... print "$_\n"; }


    _____________________
    # Under Construction
      Perhaps that works on NT4 only?? For Win2K try:
          my @net_info = `net view`;
      
      You'll only get a list of workgroups (or domains) if you use 'net view /DOMAIN'. This works on Windows 2000.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://175783]
Approved by rob_au
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-23 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found