Solved

Mapping network drive

Posted on 2012-04-02
11
1,085 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2010 mailbox move 7 68
DNS/WINS in a domain 10 96
Workstations and their computers and their printers 8 79
Windows 2008 R2 Core May 2017 Microsoft Updates 4 39
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…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
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 tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

752 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