Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mapping network drive

Posted on 2012-04-02
11
Medium Priority
?
1,094 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
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37797199
0
 
LVL 16

Accepted Solution

by:
uescomp earned 1000 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 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

927 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