why not just
net use > textfile.txt
I hope this helps !
Main Topics
Browse All TopicsWe have roughly 1500 machines and would like it when they login to have a script (preferably no popups) that somehow will just show all their currently mapped drives (similar to net use) and just dump it somewhere on the network to a file by machin name. anyone done this. Also, all the machines are in a domain. This doesn't have to a be login script but even something that can be run from a domain controller would be really cool. Please no WMI scripting as it is not turned on by default here. Thanks! No split points here. If it is something we can use you get 250.
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.
tgerbert's latest command *will* output to a file for the computer name, *BUT* this will only show connections for the user account running the script. You can not obtain such profile information remotely, because you cannot impersonate the curently logged on person.
Perhaps it would be better to use:
net use | find "\\" > \\server\share\%COMPUTERNA
So that you get a list of per computer, then per user, and which drives they have connected.
Regards,
Rob.
I think this command looks promising
net use | find "\\" > \\server\share\%COMPUTERNA
except that it would create 1500 files (1500 machines). How about something just like the above but will dump it all to one file so that we could then just import it into something like excel and then sort it. We are getting close and so are those 250 points for someone.
I'm sure it could be done with command lines, but I find CMD scripts convoluted & difficult to read; I would use VBScript. With that many client machines, though, I would consider using a simple SQL database.
Option Explicit
On Error Resume Next
Dim net
Dim file
Dim mappings
Dim i
Dim dbConnection
Set dbConnection = CreateObject("ADODB.Connec
Set net = CreateObject("WScript.Netw
dbConnection.Open "Provider=SQLOLEDB;Data Source=SQLServerName;Initi
Set mappings = net.EnumNetworkDrives
For i = 0 To mappings.Count - 1 Step 2
dbConnection.Execute "INSERT INTO TableName (ComputerName,DriveLetter,
"'" & net.ComputerName & "','" & mappings(i) & "','" & mappings(i + 1) & "')"
Next
dbConnection.Close
You could run this command and just import it into Excel as a fixed width text file....
echo %COMPUTERNAME%_%USERNAME% >> \\Server\Share\Network_Dri
That runs two command, one writes the computer name and username to the text file, the second write the network drives. Hopefully there's no write conflict issues with this approach.
Regards,
Rob.
Business Accounts
Answer for Membership
by: tgerbertPosted on 2009-01-30 at 12:09:15ID: 23512348
Select allOpen in new window