none
Need a list of mapped drives for all devices on the network

    Question

  • I 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? 
    Thursday, June 07, 2012 10:00 PM

Answers

  • 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/


    Friday, June 08, 2012 10:44 PM
  • 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

    Monday, June 11, 2012 3:19 PM

All replies

  • 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 12:28 AM
  • 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/


    Friday, June 08, 2012 10:44 PM
  • 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

    Monday, June 11, 2012 3:19 PM