Solved

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

Posted on 2011-03-14
41
1,782 Views
Last Modified: 2012-05-11
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
Comment
Question by:nimdatx
  • 19
  • 8
  • 7
  • +2
41 Comments
 
LVL 8

Expert Comment

by:jawa29
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 8

Expert Comment

by:jawa29
Comment Utility
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
 
LVL 41

Expert Comment

by:Jackie Man
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 8

Expert Comment

by:jawa29
Comment Utility
Depending on the drive letter it is very simple.

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

etc....

Jawa29
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 8

Expert Comment

by:jawa29
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 8

Accepted Solution

by:
jawa29 earned 250 total points
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 8

Expert Comment

by:jawa29
Comment Utility
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
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
Ok
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
The script needs to be placed in:   c:\windows\sysvol\sysvol\<domain name>\scripts

The NETLOGON is read only pointer to that location.
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 8

Expert Comment

by:jawa29
Comment Utility
You can multi select your users then edit that tab for all

Jawa29
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:nimdatx
Comment Utility
I put the name of the script as you requested but doesn't work.

 logon script
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
Have you tried using GP preferences instead ?

http:#a35139542
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
Yes, however the GPP didn't work for me.

 Drive Maps
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
For action you have "Update"

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

change it to Create
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
You also have "Run in user's context" set to NO...You should also change this as well
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
Do I need to put %logonusers%?

for example; \\192.168.1.173\Renal Common\%logonusers%
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
Try


\\192.168.1.173\Renal Common\%username%
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
It doesn't work.
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
what does rsop.msc show ?
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
I see the logon.bat.

 rsop
0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
Correct.   c:\windows\sysvol\sysvol\<domain name>\scripts

0
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 47

Assisted Solution

by:dstewartjr
dstewartjr earned 250 total points
Comment Utility
I would resolve all your folder redirection issues before continuing with trying to map drives
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
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
 
LVL 1

Author Comment

by:nimdatx
Comment Utility
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now