Login script asks for username and password

Posted on 2013-10-10
Medium Priority
Last Modified: 2013-10-10
 I have a server running Server 2008. There are - let's say - 5 shares on the server.  Some users needs access to all shares, others only access to 3 shares and another group of users needs access to 4 shares (this is just an example).

I have then made a simple logon.bat file so I can map the drives with NET USE command.

Now here is the problem. All users are running the same script at startup. This means that some users also tries to map drives they don't hae access to. So when they run the script - it stalls and ask for username/password.

Can I somehow add a command after each NET USE - so the script just continues - and just skips the mapping the user do not have access to?

P.S. If I run the script manually - and when it asks for username/password - I can just hit "Enter" and the script continues (only adding the drives the user have access to).

Thanks in advance.
Question by:hpdenmark
LVL 13

Accepted Solution

Daniel Helgenberger earned 1000 total points
ID: 39561845
Deploying shares with login scripts is rather outdated. If you use a group policy preference, you can target the shares by users and groups.

If this is not possible, change the script to examine the running context. For instance:
IF %username% Mary net use h: \\server\share

Assisted Solution

Raks84 earned 1000 total points
ID: 39561931
Hi hpdenmark,

I would suggest the same as helge000, its better we create group policy and assign the specific user names and groups to access the required share drives. Its tension free.

You can create Group policies in your server manager, you will have to add the Group Policy feature under Features in server manager, which is a step by step wizard. Later on, expand Group Policy and add a forest and link it to your existing DNS and AD. from there you can automate almost any requirement for your client, you have to select the required Group policy and add your users or groups to it. Once done, restart the client machine or perform a gpupdate in the client machine command prompt with administrator rights or from run box, right click cmd prompt and select run as administrator. If the gpupdate cmd doesn't work try gpupdate /force command either in run or command prompt. That should do the trick.

Remember we have to create separate Group policy's for the same process we want to execute, in your case for every different group or users to access specific share drives, separate GP's for share drive access has to created/enabled linking to the desired share drive and adding required users or groups.

Hope this helps.

LVL 10

Expert Comment

by:Pramod Ubhe
ID: 39562084
If you want to stick with your existing plan, try configuring 'List folder Contents' permissions  for 'Everyone' and make sure you have set correct share permissions as well.

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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

In a question here at Experts Exchange, a member was looking for "a little app that would allow sound to be turned OFF and ON by simply clicking on an icon in the system tray". This article shows how to achieve that, as well as providing the same OF…
Native ability to set a user account password via AD GPO was removed because the passwords can be easily decrypted by any authenticated user in the domain. Microsoft recommends LAPS as a replacement and I have written an article that does something …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

624 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