Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Listing Windows 2000 Shares

by nimdokk (Vicar)
on Mar 22, 2005 at 14:09 UTC ( [id://441459]=perlquestion: print w/replies, xml ) Need Help??

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

I am working on a script that pulls some system information that we need on hand prior to an upgrade. Part of that information is a list of all the shares on the server. Easy enough to get with "net share," especially since this shows hidden shares as well as regular shares. I looked at some samples in Win32::Netresource, and it seemed to pretty good except for two things: 1) it did not seem to show me the path to the directory being shared (just the displayed share name) and 2) did not show hidden shares (or even the default admin shares). Is there something I might be missing? Is there another module to possibly use to get the info I need? The script I'm playing with is the example in the Win32::Netresource documentation for enumerating resources on a particular host. I don't want to spend a lot of time on this, just want something quick and dirty. If I can't find something quickly, I'm going to resort to parsing out the "net share" command.

Thanks

Replies are listed 'Best First'.
Re: Listing Windows 2000 Shares
by gellyfish (Monsignor) on Mar 22, 2005 at 15:06 UTC
      Thanks a lot. That pointed me in the right direction. Found a sample Perl script pulling exactly what I needed out on the M$ site. :-)
Re: Listing Windows 2000 Shares
by MrCromeDome (Deacon) on Mar 22, 2005 at 14:32 UTC
    I can't say I'm familiar with Win32::Netresource, but if you're looking for quick and dirty, you could always capture the output of "net use" with backticks, ala:
    my @output = `net use`; # Do something with @output here. . .
    Good luck, whatever you try!
    MrCromeDome

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found