Scan for shared folders on local PCs.

Dear All,

Is there anyway to scan the whole network for shared folders on local PCs?
I've looked around a bit without any luck.

Thank you for your help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dbruntonQuid, Me Anxius Sum?Commented:
At the command line try net view.
Don't think you can scan each specific shared folder.
net view is the same as viewing my network places, which is the furthest you can go.
Check this:

SoftPerfect Network Scanner is a free multi-threaded IP, NetBIOS and SNMP scanner with a modern interface and several advanced features. It is intended for both system administrators and general users who are interested in computer security. The program pings computers, scans for listening TCP ports and displays which types of resources are shared on the network (including system and hidden).

Easy interface and it can do the job for you I think,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Paste the script below into a text file with a .vbs extension.  Customize the value of the strContainer variable on line 4 with the distinguished name of the OU or domain to search under.  Customize the contents of the arrExclude array on line 5 with the share names to exclude from your query.  Running the script will check each computer and write share information to a comma-delimited text file.

Const ForWriting = 2
strContainer = "ou=workstations,dc=yourdomain,dc=local"
arrExclude = Array("c$","d$","e$","f$","admin$","ipc$","print$")
strReport = "report.csv"
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReport = objFSO.OpenTextFile(strReport, ForWriting, True)
objReport.WriteLine "Computer,Share Name,Share Path,Share Description"
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
    "Select Name From 'LDAP://" & strContainer & "' Where objectCategory='computer'"  
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
    strComputer = objRecordSet.Fields("Name").Value
    If PingCheck(strComputer, 1, 0) Then
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
        Set colItemList = objWMIService.ExecQuery("SELECT * FROM Win32_Share")
        For Each objItem in colItemList
            blnExcluded = False
            For Each strExclude in arrExclude
                If LCase(objItem.Name) = LCase(strExclude) Then
                    blnExcluded = True
                End If
            If Not blnExcluded Then
                objReport.WriteLine strComputer & "," & objItem.Name & "," & Chr(34) & _
                    objItem.Path & Chr(34) & ","  & Chr(34) & objItem.Description & Chr(34)
            End If
    End If
Function PingCheck(strTarget, strPings, intPause)
    Const ForReading = 1
    Set objShell = CreateObject("WScript.Shell")
    strTempDir = objShell.ExpandEnvironmentStrings("%temp%")
    strTempFile = strTempDir & "\script-" & strTarget & ".txt"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objShell.Run "%comspec% /c ping -n " & strPings & " -w 100 " & _
        strTarget & ">" & strTempFile, 0, True
    WScript.Sleep intPause
    objShell.Run "%comspec% /c ping -n " & strPings & " -w 100 " & _
        strTarget & ">>" & strTempFile, 0, True
    Set objTempFile = objFSO.OpenTextFile(strTempFile, ForReading)
    strOutput = objTempFile.ReadAll
    objFSO.DeleteFile strTempFile, True
    If InStr(strOutput, "bytes=32") > 0 Then
        PingCheck = True
        PingCheck = False
    End If
End Function

Open in new window

chinguettiAuthor Commented:
Thanks for your help! I went for the network scanner for it's simplicity.
Also, is there any software that can scan for local accounts?

Thank you for your help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.