Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View network drives? 1

Status
Not open for further replies.

SysAdmin3000

Technical User
Aug 15, 2006
15
US
I have scripts that will map drives and printers and delete drives and printers. My next goal is to figure out what everyone is mapped to.

I just inherited a new shop that I have to completley redesign. I will be turning up a new file server and migrating user data to it. I wanted to take a peek at each workstation and look at what they are currently mapped to and save that information to a file.

Then when I turn up the new file server I can make sure people are accessing the data that they require.

I initially created a web form for people to fill out but, I do not trust the data, not everyone has filled it out and the responses have been very...unique.

thanks
 
You could try this WMI solution... (code snippet from Sapien Primal Script)

Code:
On Error Resume Next
Dim strComputer
Dim objWMIService
Dim propValue
Dim objItem
Dim SWBemlocator
Dim UserName
Dim Password
Dim colItems

strComputer = "."
UserName = ""
Password = ""
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkConnection",,48)
For Each objItem in colItems
	WScript.Echo "AccessMask: " & objItem.AccessMask
	WScript.Echo "Caption: " & objItem.Caption
	WScript.Echo "Comment: " & objItem.Comment
	WScript.Echo "ConnectionState: " & objItem.ConnectionState
	WScript.Echo "ConnectionType: " & objItem.ConnectionType
	WScript.Echo "Description: " & objItem.Description
	WScript.Echo "DisplayType: " & objItem.DisplayType
	WScript.Echo "InstallDate: " & objItem.InstallDate
	WScript.Echo "LocalName: " & objItem.LocalName
	WScript.Echo "Name: " & objItem.Name
	WScript.Echo "Persistent: " & objItem.Persistent
	WScript.Echo "ProviderName: " & objItem.ProviderName
	WScript.Echo "RemoteName: " & objItem.RemoteName
	WScript.Echo "RemotePath: " & objItem.RemotePath
	WScript.Echo "ResourceType: " & objItem.ResourceType
	WScript.Echo "Status: " & objItem.Status
	WScript.Echo "UserName: " & objItem.UserName
Next

You would have to feed it the computer names through some process of your choice and choose what fields and how to output the results... but this should give you a starting point.



strebor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top