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.