Need a list of mapped drives for all devices on the network
-
Thursday, June 07, 2012 10:00 PMI need a script that will pull a list of mapped drives off all computers on the network. It would need to write the list to a file with the computer name in the file name (i.e. mikes-pc.txt) and write them to a networked directory. I know the net use command will give me what I need for a single pc, but I need it for all computers on the network and to write it to a common place so I can easily access. Can anyone help?
All Replies
-
Friday, June 08, 2012 12:28 AM
Drives are mapped to users and not to PCs. You cannot pull mapped drives remotely.
Give the users a batch file to run that writes to a network drive with the net use command.
¯\_(ツ)_/¯
-
Friday, June 08, 2012 10:44 PMModerator
For a batch file something simple like this would work.
net use >\\server\share$\Audit_folder\%ComputerName%.txt
You could run it in a login script. I actually did this years ago and it worked great.
Blog: http://scriptimus.wordpress.com/
- Edited by Andrew BarnesModerator Friday, June 08, 2012 10:45 PM
- Marked As Answer by IamMredMicrosoft Employee, Owner Monday, June 18, 2012 5:25 AM
-
Monday, June 11, 2012 3:19 PMModerator
If computers are used by only one user, Andrew's script should do the trick.
If you have multiple users per computer, you could use
net use > \\server\share$\audit_folder\%COMPUTERNAME%_%USERNAME%.txt
...or something similar. In this way every user on a computer will log to a separate file.
Bill
- Proposed As Answer by Richard MuellerMVP, Moderator Wednesday, June 13, 2012 3:50 AM
- Marked As Answer by IamMredMicrosoft Employee, Owner Monday, June 18, 2012 5:25 AM

