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

Logon script to Map drives

When my logon script to map drives runs for end users, it prompts them for a password.  It does not do that for me.  What can it be?
NET USE Z: /delete
NET USE Z: "\\cscuadmin\e$\Home folders" /PERSISTENT:YES  
3 Solutions
The e$ share is an administrative share that is only accessible to Domain Administrators (or local administrators on a file server) by default.  Create a share for your users and grant Everyone-->Full Control to the share.
shannon_1680Author Commented:
Ok, that worked, the cmd to enter in a password does not show up anymore; however; this logon to map this drive is to access their personal folders.  Now they can see everyone's folder.  This didnt happen before.
Really, you should only be using the E$ share for administrative purposes. Standard non Domain Admins have no access to this share.

I assume there are subfolders below the "Home folders" directory named as each user's username. What I suggest you do is migrate to a VBS based script, and map the Z: drive directly to each user's subfolder based on their username. I've attached an example (with a persistent drive) which shows how to do this.

on error resume next
' Logon Script to map network drives
' Objects
Dim Network
Set Network = CreateObject("WScript.Network")
' User's username
Dim Username
Username = Network.UserName
Network.MapNetworkDrive "N:", "\\server\UserData\" & Username, true

Open in new window

The above should work fine, though simply adding username to the bat script should also work.  It is just a question of permissions, really, but I'm guessing that under the share there have been exclusives set?


NET USE Z: /delete
NET USE Z: "\\cscuadmin\e$\Home folders\%username%" /PERSISTENT:YES  

should work fine.  If you run into permissions problems since e$ is typically just admin usage, preface it with another line to grant permissions.

cacls \\server\e$\Home folders\%username% /e /t /g %username%:f
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

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now