Scan network for each computers Mapped Drives

100 pts.
Tags:
Mapped drives
Network performance
Network scanning
Hello, Our companies network and shared network drives has become majorly disorganized. I was wondering if anyone had ideas on how to check computers on the network and view what networked drives they have in My Computer. Thank you for the input

Answer Wiki

Thanks. We'll let you know when a new response is added.

With enough privileges (E.g. you’re Domain Admin) you might be able to perform a <b>NET VIEW \\COMPUTERNAME</b> and see which shares the computers have

——————

Here’s an script that could help. Just create a new vbs file with this code:

<pre>strComputer=”***** PUT THE COMPUTER NAME HERE *****”
Const HKEY_USERS = &H80000003
Set objWbem = GetObject(“winmgmts:”)
Set objRegistry = GetObject(“winmgmts://” & strComputer & “/root/default:StdRegProv”)
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!” & strComputer & “\root\cimv2″)

‘Go and get the currently logged on user by checking the owner of the Explorer.exe process.

Set colProc = objWmiService.ExecQuery(“Select Name from Win32_Process” & ” Where Name=’explorer.exe’ and SessionID=0″)

If colProc.Count > 0 Then
For Each oProcess In colProc
oProcess.GetOwner sUser, sDomain
Next
End If

‘Loop through the HKEY_USERS hive until (ignoring the .DEFAULT and _CLASSES trees) until we find the tree that
‘corresponds to the currently logged on user.
lngRtn = objRegistry.EnumKey(HKEY_USERS, “”, arrRegKeys)

For Each strKey In arrRegKeys
If UCase(strKey) = “.DEFAULT” Or UCase(Right(strKey, 8)) = “_CLASSES” Then
Else

Set objSID = objWbem.Get(“Win32_SID.SID=’” & strKey & “‘”)

‘If the account name of the current sid we’re checking matches the accountname we’re looking for Then
‘enumerate the Network subtree
If objSID.accountname = sUser Then
regpath2enumerate = strkey & “\Network” ‘strkey is the SID
objRegistry.enumkey hkey_users, regpath2enumerate, arrkeynames

‘If the array has elements, go and get the drives info from the registry
If Not (IsEmpty(arrkeynames)) Then
For Each subkey In arrkeynames
regpath = strkey & “\Network” & subkey
regentry = “RemotePath”
objRegistry.getstringvalue hkey_users, regpath, regentry, dapath
wscript.echo subkey & “:” & vbTab & dapath
Next
End If
End If
End If
Next</pre>

See <a href=”http://www.visualbasicscript.com/m_28529/tm.htm”>this thread</a>, where this script was originally posted.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following