Mapped drives for all terminal server users?

gromack used Ask the Experts™
I have a terminal server (2008 R2) that about a dozen users log into, that's part of a 2008 SBS domain. What would be the easiest way to map a drive for all users?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

use a group policy to map the drives or a logon script that runs when users connect via remote destkop

Yes, lots of ways.  

Depending upon what was already in place I would use policies or do it as part of an existing login script - e.g. you could check for a particular computer name or various other environment variables if it is a batch script, similar ways if it is VBScript etc.

So do you curently using group policy preferences, group policy assigned user login scripts, or traditional "NETLOGON" directory login scripts?

Loopback is a good way too, means you can have it run an extra or totally different USER part of policy based on the OU of the COMPUTER rather than the computer getting it's OU of policies and the user it's OU's.  This is quite a good explanation of the process:

You can also do it specifically as part of their RDP settings:

The login script way can be as simple as something like

@echo off
if /i "%computername%"=="MY-TS-NAME" (
  echo On terminal server...
  NET USE X: \\server\share
) ELSE (
  echo Not on terminal server
  echo Do stuff for not on terminal server

echo Do stuff for both...

Open in new window

Or, you can put a script net use in start-up folder for all users on the TSE computers. This will restrict the connection to the TSE session.

JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

CoralonSenior Citrix Engineer

The "proper" way to do this is using the USRLOGON.CMD sequence.  I have detailed this in my article.

Obviously, I would strongly recommend this approach.  


all of the above suggestions are valid but no single one is the 'proper' way to achieve it. It generally comes down to your requirements, as each option has it's own pros/cons.

If you provide more info we can offer more detailed advice, but from what little we know I would say both mapping drives by GPO and a logon script in AD would be fairly straight forward, but the AD one would probably work on other machines in addition to the TS so may not be suitable.
I'd personally be cautious of putting a script inthe TS startup-folder as it may be accessible by the users.

As we have said and Steve says too there are loads of ways.  Loopback processing using GPO would probably the way I would consider, but lot depends one TS server, lots of them, few users, loads of users etc.



Sorry to have neglected this, as I had to go out of town for a couple of days.
Years ago (NT 4), I had a small network, where I had a log on script & a batch file that mapped shares when logging onto the local network, but didn't want to go back & manage these on a by user basis.
Some of the users work in office at times, where all the drives have been mapped when initially setting up the computers, so I'd like this specific to the terminal server log ons.
I haven't set up policies, so if there's a 'setting up a local policy for dummies' or a way to do this through the remote desktop services, I'd appreciate it.
It is fairly easy to run central scripts using group policy, and to map drives based on policies without any scripting at all now - what version servers are you running for your domain as it is different depending how old you have.... presume not STILL NT4!?

In which case lets forget more of the "proper" ways then, as sounds like users with little in the way of policies or other settings in place and with one server.

To do like dan_bagut suggested above you can create batch file "login.cmd" using notepad and save-as choose "all files" as type.  Put it on your terminal server in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup with

net use x: \\server\share

To check this is right for yours, if you click on start menu, then right click on Startup folder and choose Explore All Users will take you to the path for the startup if different on that server.



Thanks, that's just what I was looking for, & no, I abandoned NT4 quite a while ago, ha-ha!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial