Solved

Mapping network drive

Posted on 2012-04-02
11
1,083 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

791 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