I need a utility to tell me what local mapped drives there are.

By arashcuzi ·
I'm a network administrator for a company whose past IT guys have been less than ethical and meticulous in their work, so now I have an entire WAN to clean up and I'm stuck fiddling with Active Directory, VBS scripts and all that other fun stuff.

Basically, I need to know how to enumerate a user's mapped drives (even using a VBS script EnumNetworkDrives method of WSHNetwork) and output to a text document or CSV, or something.

VBS has an enumerator which creates a variable for disconnecting all the mapped drives, and maybe a net use echo will work, I'm not sure, I just need some help with this. If anyone knows a way of enumerating a user's Statically Mapped Network Drives (via Windows explorer shell - Map Network Drive) and export to .txt or .csv please let me know.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

net use

by Churdoo In reply to I need a utility to tell ...

Not sure if I'm over-simplifying, or if I really understood what you're asking, but "net use" with no arguments will list what you're asking without the need for scripting. You can further redirect the output to a text file, as in:
net use >outputfile.txt

Collapse -


by arashcuzi In reply to net use

Yeah, thanks a bunch, I figured a simple net use would work, but I was unsure how to output to a text file, I guess my IT Administrator wants to use it in some sort of PHP program as a way to audit, but we need to know who has what drive mappings and which ones were statically assigned at each individual station, so far here's what I have:

net use > \\server\writable_share\%computername%_%username%.txt

Let me know if you think of something else that may give more info or work better, but I'm sure this will nail it.

Again thanks, this was my first post, I never imagined I'd get darn near immediate replies.

Collapse -

and if you want to use a single file

by Churdoo In reply to Thanks!

and if you want to use a single file to hold this information, then you could use the APPEND redirect and do something like this:

echo %date%_%time%: %computername%_%username% >>\\server\writable_share\netdrives.txt
net use >>\\server\writable_share\netdrives.txt

Related Discussions

Related Forums