oh and for log file you can see the following link ,, sorry I didnt mention that in my first post
found it from expers exchange !!!
http://www.experts-exchang
Main Topics
Browse All TopicsShort story: I need a script (and best way to run it GPO LOGON etc) to log all mapped drives and report it back to a network share.
Long Story:
I am working for a client that had 10 servers (if putting a sticker that says "do not touch server" on a dell P4 makes it a server) running random shares. I am removing 8 of these "servers" and installed a real server. Since there is no logic behind what and where the shares are to begin with and most users have shares mapped staticly I need to know what people are connecting to. A few years ago I created a script that run at logon and reported the mapped drives to a log file that was sent to a network share. I have forgotten most of my scripting in that time and do not have the time to relearn it.
Please help
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
oh and for log file you can see the following link ,, sorry I didnt mention that in my first post
found it from expers exchange !!!
http://www.experts-exchang
Set oNet= WScript.CreateObject("WScr
Set oDrives = oNet.EnumNetworkDrives
oUser = oNet.UserName
oComputer = oNet.ComputerName
Set oFilesys = CreateObject("Scripting.Fi
Set oFiletxt = oFilesys.CreateTextFile("f
sPath = oFilesys.GetAbsolutePathNa
sFilename = oFilesys.GetFileName(sPath
oFiletxt.WriteLine "Network drive mappings for "&oUser& " on " & oComputer
For i = 0 to oDrives.Count - 1 Step 2
oFiletxt.WriteLine "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
Next
oFiletxt.Close
This does what I need.
Thanks for trying
Business Accounts
Answer for Membership
by: drequinoxPosted on 2008-07-21 at 06:45:27ID: 22050416
the following script will give you the list of all mapped drives
strComputer = "."
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colDrives = objWMI.ExecQuery("select * from Win32_MappedLogicalDisk")
WScript.Echo "Mapped Drives:"
for each objDrive in colDrives
WScript.Echo " Device ID: " & objDrive.DeviceID
WScript.Echo " Volume Name: " & objDrive.VolumeName
WScript.Echo " Session ID: " & objDrive.SessionID
WScript.Echo " Size: " & objDrive.Size
WScript.Echo
next