• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2317
  • Last Modified:

How can I run a report of all mapped drives for every user on my network?

Hello,

I'm interested in finding out how to run a report of all our users mapped drive they have on there computer. Is there a way to do this with some free software and it will give me a good detailed report of all my users (LAN/WAN) mapped drives with drive letters?

Thanks,

nimdatx
0
Jaime Campos
Asked:
Jaime Campos
  • 19
  • 8
  • 7
  • +2
2 Solutions
 
jawa29Commented:
Hi nimdatx

You could include in the last part of a login script this command line

net use > C:\mappeddrives.txt

You could also redirect this to a server share

net use > \\servername\share\computername-mappeddrives.txt

Jawa29
0
 
Jaime CamposAuthor Commented:
I'm new to logon scripts and the net use cmd. Can you explain the steps for me to successfully use your recommended logon script?

Thanks so much.

nimdatx
0
 
jawa29Commented:
Lets assume your running a Domain?

On each user in Active Directory Users & Computers they have a profile tab, in this tab is a section to add a login script. This login script can be something like a .bat(Batch Command) file or maybe a .vbs(VBScript).

So lets say we create a file called logon.bat and save this in the NETLOGON share of your server, this could then be referenced on the Profile tab under logon script.

You could simply add the command I supplied in a .bat file that would run as the user logged in.

Jawa29

0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
Jackie ManCommented:
Have a look of a google book in the link below and you will have an idea of how "net use" command works.

http://books.google.com.hk/books?id=bYOiQWBTSS0C&pg=PA271&lpg=PA271&dq=net+use+list+mapped+drives&source=bl&ots=7hcX_mXmC_&sig=LLb0TXcmWlQq5RKIacz7JwF9m0U&hl=zh-TW

net use is a basic command from windows 2000 to windows 7.
0
 
Jaime CamposAuthor Commented:
ok, where would the output be saved? Another words, where would I go view the results of everyones mapped drive information?

I have over 250 users that are mapped to a drive
\\Fileserver\Renal Common
\\Fileserver\ACCT
etc....

and I wanted to know who was mapped so i can go to each machine to remap to our new Fileserver

\\Filesrv\Renal Common
\\Filesrv\ACCT
etc....

now that I have a more understanding on how to utilize a logon script, ny thought is maybe I can do a logon.bat to remap everyones drive. What would be the NET USE command to do this?

0
 
jawa29Commented:
Depending on the drive letter it is very simple.

net use G: /del
net use G: \\filesrv\renal common

etc....

Jawa29
0
 
Jaime CamposAuthor Commented:
Awesome. I'm testing and I hope it works. Thats it? I just copy the following cmd into a notepad and save as a .bat?

net use G: /del
net use G: \\Filesrv\Renal Common

I then save in the NETLOGON and edit GP to utilize this logon script?

 
0
 
jawa29Commented:
Yes

If you want to distribute a login script using GPO then I would recommend VBScript, with the batch file above you need to add that to the users Profile tab in AD Users & Computers.

Glad I could help
Jawa29

0
 
Jaime CamposAuthor Commented:
Ok, I created a .bat file with the following script on my desktop to test out before I save in NETLOGON

net use G: /del
net use G: \\192.168.1.173\renal common

When I run on desktop it deletesmya existing map drive G:, however it doesn't create my new map drive G: \\192.168.1.173\Renal Common. Any idea why?

Thanks,

nimdatx



0
 
jawa29Commented:
You need to put quotes around the network path.
This only needs to be done if there is a space in the network path.

E.G. "\\192.168.1.173\Renal Common"

Jawa29
0
 
Jaime CamposAuthor Commented:
That WORKED!!!! Real Close. Now when i save the document into my NETLOGON folder (I went to run - \\192.168.1.173\NETLOGON and moved .bat file into that folder) the scrip/.bat file seem to not run when I rebooted. Am I missing something?

THANKS SO MUCH.
0
 
jawa29Commented:
You still need to add filename.bat to the users Profile tab in Active Directory Users & Computers (where filename is the name you called the bat file)

You need to login to your Domain Controller to do this stage.

Jawa29
0
 
Steven CarnahanNetwork ManagerCommented:
Did you: "with the batch file above you need to add that to the users Profile tab in AD Users & Computers." as stated by jawa29 ins ID:35130625
0
 
Jaime CamposAuthor Commented:
Ok
0
 
Jaime CamposAuthor Commented:
When adding .bat file in the users profile tab in ADUC, am I adding the name of the file (logon.bat) within logon script underneath profile path. What is the proper way to add this logon script in profile tab? It's not working when I just put in the name of the file. Note, I copied the .bat file in the NETLOGON.

Thanks,

nimdatx
0
 
Steven CarnahanNetwork ManagerCommented:
The script needs to be placed in:   c:\windows\sysvol\sysvol\<domain name>\scripts

The NETLOGON is read only pointer to that location.
0
 
Steven CarnahanNetwork ManagerCommented:
Also, only put the name of the script in.  

YES:  login.bat
NO: c:\login.bat
NO: c:\windows\sysvol\sysvol\<domain name>\scripts\login.bat
NO c:\netlogon\login.bat
0
 
Jaime CamposAuthor Commented:
pony10us, thanks. Do I have to do it for every account profile or is there an easier way to change for my entire domain? I mean I know I can use GP, but I'm not sure how to use this script.
0
 
jawa29Commented:
You can multi select your users then edit that tab for all

Jawa29
0
 
DonNetwork AdministratorCommented:
Mapping drives using logon scripts is too laborious


GP Preferences Will Reduce Logon Scripts : Mapping Drives

http://blogs.technet.com/b/grouppolicy/archive/2009/02/11/gp-preferences-will-reduce-logon-scripts-mapping-drives.aspx
0
 
Jaime CamposAuthor Commented:
I put the name of the script as you requested but doesn't work.

 logon script
0
 
DonNetwork AdministratorCommented:
Have you tried using GP preferences instead ?

http:#a35139542
0
 
Jaime CamposAuthor Commented:
Yes, however the GPP didn't work for me.

 Drive Maps
0
 
DonNetwork AdministratorCommented:
For action you have "Update"

If there is no previous mapped drive as "J" then update will fail.

change it to Create
0
 
DonNetwork AdministratorCommented:
You also have "Run in user's context" set to NO...You should also change this as well
0
 
Jaime CamposAuthor Commented:
ok this is after changes

<?xml version="1.0" encoding="utf-8" ?>
- <Drive clsid="{935D1B74-9CB8-4e3c-9914-7DD559B7A417}" name="J:" status="J:" image="0" changed="2011-03-15 16:49:33" uid="{AE75A38C-0963-431F-88EC-4AA6DC8727E1}" userContext="1" bypassErrors="1">
  <Properties action="C" thisDrive="NOCHANGE" allDrives="NOCHANGE" userName="" path="\\192.168.1.173\Renal Common" label="Renal Common" persistent="0" useLetter="1" letter="J" />
  </Drive>
0
 
Jaime CamposAuthor Commented:
Do I need to put %logonusers%?

for example; \\192.168.1.173\Renal Common\%logonusers%
0
 
DonNetwork AdministratorCommented:
Try


\\192.168.1.173\Renal Common\%username%
0
 
Jaime CamposAuthor Commented:
It doesn't work.
0
 
DonNetwork AdministratorCommented:
what does rsop.msc show ?
0
 
Jaime CamposAuthor Commented:
I see the logon.bat.

 rsop
0
 
Jaime CamposAuthor Commented:
Tuesday, March 15, 2011 1:11:00 PM

Group Policy Drive Maps processed successfully but failed to log resultant set of policy information.

Additional Information:
The user 'J:' preference item in the 'My Documents Redirect {35E961C8-D9D2-4409-A548-FE0F33D33A5C}' Group Policy object did not apply because it failed with error code '0x80070037 The specified network resource or device is no longer available.'%%100790273

The client-side extension could not log RSoP data because it failed with error code '0x8004401e <unknown-message-text>'.


Tuesday, March 15, 2011 1:10:38 PM

Folder Redirection failed due to the error listed below.
Cannot complete this function.

Additional Information:
Failed to apply policy and redirect folder "Videos" to "%HOMESHARE%\Users\JaimeC.RAPA.000\My Videos".
 Redirection options=80009001.
 The following error occurred: "".
 Error details: "The specified path is invalid.
".
0
 
Steven CarnahanNetwork ManagerCommented:
Sorry I got called away on an emergency.

When you saved the logon.bat you did place it on the server in the scripts folder and not on the local workstation correct?

0
 
Jaime CamposAuthor Commented:
Correct.   c:\windows\sysvol\sysvol\<domain name>\scripts

0
 
Jaime CamposAuthor Commented:
The reason I don't use GPP is that at this time it doesn't seem to work and deploying client within WSUS is whole other task I'm not familiar with. The logon script seems to be the best if I can get to work.
0
 
DonNetwork AdministratorCommented:
I would resolve all your folder redirection issues before continuing with trying to map drives
0
 
DonNetwork AdministratorCommented:
0
 
Steven CarnahanNetwork ManagerCommented:
Ok, let's try something. Change your logon.bat to the following:

net use G: /del
net use G: "\\192.168.1.173\renal common"
pause

This should stop the logon.bat at the end revealing any error messages encountered. I am thinking that there may be a permissions issue either with the logon.bat or the "\\192.168.1.173\renal common"

0
 
Jaime CamposAuthor Commented:
I disabled all my other GPOs (my document redirect, GPP) and rebooted my system and it worked. Not sure what happened.

It's working now, but if i disable GPO with logon script will it disconnect map drive once it's been mapped?

THANKS SO MUCH for hagging with me through this issue.
0
 
Jaime CamposAuthor Commented:
0
 
Steven CarnahanNetwork ManagerCommented:
So it comes back to an order/inheritence issue of GPO's. There must be a more restrictive setting for drives in one of the other GPO's, I would enable each one at a time and see which one "breaks" it. Once the GPO applies it should remain unless/until someone overrides it with another.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 19
  • 8
  • 7
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now