Solved

Mapping network drive

Posted on 2012-04-02
11
1,087 Views
Last Modified: 2012-04-07
Hi,
How can I map a network drives when user logging in to windows 2003 R2 domain using logon script or group policy editor. I have the following two folders

\\myserver\home\%username%
\\myserver\public folder$

I want the mapped network drive to appear on the desktop and in my computer.

please help.

Thanks
0
Comment
Question by:ayha1999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37797114
You can have logon script to map the drives.

@echo off
Net use x: \\myserver\home\%username%
Net Use y: \\myserver\public folder$
0
 
LVL 7

Author Comment

by:ayha1999
ID: 37797164
what is the extension of the script file, bat or vbs? please give me the complete script and how to configure it.

thanks
0
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37797178
save the above lines as a bat file and put in the login script for the user.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37797199
0
 
LVL 16

Accepted Solution

by:
uescomp earned 250 total points
ID: 37797203
As a slight recommendation I would use .vbs vs bat if you are running this from a server with windows 2008.  I have seen very strange issues before with bat files and vbs gives you alot more playing room.  Like mapping drives and printers etc if you wanted to do more.

Simple Example:

On Error Resume Next

Set objNetwork = CreateObject("WScript.Network")

'remove network drives
objNetwork.RemoveNetworkDrive "H:"
objNetwork.RemoveNetworkDrive "I:"
objNetwork.RemoveNetworkDrive "S:"


'map network drives
objNetwork.MapNetworkDrive "H:" , "\\servername\sharename"
objNetwork.MapNetworkDrive "I:" , "\\servername\sharename"
objNetwork.MapNetworkDrive "S:" , "\\servername\sharename"

'map network printer, must be shared off of server
objNetwork.AddWindowsPrinterConnection "\\servername\printersharename"

'set default printer
objNetwork.SetDefaultPrinter "\\servername\printersharename"
0
 
LVL 7

Author Comment

by:ayha1999
ID: 37797227
How can do it for all users one time instead of doing it for each user?

thanks
0
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37797248
Select all the users and open the properties and browse to the script.
0
 
LVL 7

Author Comment

by:ayha1999
ID: 37797612
I careated creted group policy, a bat file and put in the following location.

\\mydomain.com\SysVol\mydomain.com\Policies\{80B42946-49E6-4428-85F1-43C0B5382A88}\User\Scripts\Logon

but when user logs in , no network drive appears in my computer or desktop. If he browse the bat file located in above location and execute then it ask for user and and password and mapsthe network drives. is there any problem with the location?

thanks
0
 
LVL 7

Author Comment

by:ayha1999
ID: 37797624
The physical location is
C:\WINDOWS\SYSVOL\sysvol\mydomain.com\scripts
0
 
LVL 16

Assisted Solution

by:uescomp
uescomp earned 250 total points
ID: 37798264
Just to let you know if your AD structure is organized in a certain way I have seen problems when it was running.  Example:  You have the following Organizational Units (Company Users > Department 1 and Department 2)

You would have to create a group policy for both department 1 with the script and department 2 with the script.  I have seen it not run on many occasions when it was assigned to the top level which in this case would be (Company Users).  One thing you can do is do a \\Servername and navigate to the script and run it manually so see if it works.
0
 
LVL 7

Author Closing Comment

by:ayha1999
ID: 37819600
Thanks
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses

615 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