Jump to content

Recommended Posts

Posted

I have .bat files which determine the mapped drives for different groups of users (admin, teaching, care works etc).

 

For each group of users, a policy is in place that will map the drives automatically when the users log in.

 

This has worked fine for so long, but recently the drives don’t seem to be mapping anymore. I have not made any changes that may be causing this, all the policies and files are still in the relevant places.

 

I do, however, have a script for ALL users, which states the drives that everyone should have. These drives are also listed on their own department scripts. Could this be a reason for why it is doing it?

Posted

What do you mean by this:

 

I do, however, have a script for ALL users, which states the drives that everyone should have. These drives are also listed on their own department scripts. Could this be a reason for why it is doing it?

 

Generally speaking, you have one logon script per group of users as they're all accessing the same resource(s). Logon scripts should be in your NETLOGON share.

 

If you type \\SERVERNAME\NETLOGON you can verify this. Sometimes network drives don't map due to loss of connectivity or that there's a problem with permissions.

Posted

Hi

 

I am aware of the netlogon share as that is where I create any new scripts.

 

What I eant by that quote was that I have a script which applies for all users, which runs when the log in. I also have scripts for all the different departments... There is some doubling of content eg "net use r: \\server\ppil_data$ \y" which will appear in the script for all users as wll as the script for a department.

 

The reason for this is because there are some departments that don't have their own logon scripts because they don't have particular drives that need mapping just for them. Tey only need the generic ones.

Posted
I'd probably get rid of the doubling up if you can. Edit your scripts so you have the common drives being mapped, then any additional user-specific mappings applied afterwards. Dunno why you're seeing this problem though, never had experience of things not getting mapped for anything other than temporary network connectivity blips.
Posted

I agree with Ryan, get rid of the doubling. What I wrote regarding logon scripts was just a typical example. There's no reason why (in theory) each user could have a different logon script.

 

You can copy an existing script (say Staff1.bat) and name it Staff2.bat. Then make the change in Active Directory for that user too.

Posted
Could it be that the clients are connecting too quickly? Are they new machines that are having the mapping problem? I have had similar problems in the past but was generally down to network problems. Have you got the clients waiting for the network on boot set in the GPO?
Posted

I have got rid of the script for all users, and just amended each department so that they have all the relevant drives they need, as wel as all the common ones.

 

My scripts do not delete the drives before adding new ones.

 

Sorry about typing sometimes - keyboard is really playing up today.

Posted (edited)

Just before mapping the drives, place this in your logon script:

 

net use I: /delete /y
net use J: /delete /y
net use K: /delete /y
net use L: /delete /y
net use M: /delete /y
net use N: /delete /y
net use O: /delete /y

net use I: \\SERVERNAME\drive1
net use J: \\SERVERNAME\drive2
net use K: \\SERVERNAME\drive3
net use L: \\SERVERNAME\drive4
net use M: \\SERVERNAME\drive5
net use N: \\SERVERNAME\drive6
net use O: \\SERVERNAME\drive7

 

Change the letters with the letters you're using to map network drives.

Edited by Michael
Posted
I have got rid of the script for all users, and just amended each department so that they have all the relevant drives they need, as wel as all the common ones.

 

My scripts do not delete the drives before adding new ones.

 

Sorry about typing sometimes - keyboard is really playing up today.

 

this will be the problem, when a user logs of it doens't always delete the share, so when you try to map a new share it will look at the existing one and not map a new drive. if you use the script below to delete before you add , where p s and z are the drive names.

net use p: /d

net use s: /d

net use z: /d

Posted
Double-check that the CD/DVD drive letter is set properly. We had a prob where the user homeshare wouldn't map (drive letter h:) turns out the DVD drives on the HP desktops had decideded to become H: and thus the net use command failed.
Posted

Thanks guys, I have added the delete into the scripts and I will test it out and see where I am.

 

Does it matter whether I use /delete or /d?

Posted

Leonie

 

From what i can gather from reading other peoples posts, most people seam to agree that its is a combination of stacking more than one bat file and/or not disconnecting the mapped drives before it remaps the new ones.

Have you thought about instead of using a vbs script to map your drives instead of a batch file. The using the GPO to deploy it, here is an example of the one i use and i can stack multiple scripts without them interferring with each other.

_______________________________________________________________

 

sample.vbs

_______________________________________________________________

 

On Error Resume Next

 

Dim net

Set net = CreateObject("WScript.Network")

net.MapNetworkDrive "S:", "\\server1\share"

 

mDrive = "S:\"

Set oShell = CreateObject("Shell.Application")

oShell.NameSpace(mDrive).Self.Name = "Shared Folder"

 

_______________________________________________________________

 

This script also in the second part makes the mapped drives look neater in 'my computer', and from what i can tell runs quicker than a .bat file.

Been running it on our systems for over 2 years and never had a problem with it.

Good luck, Hope this helps

 

Justin

Posted

Thanks Justin, that's great. I have tested it with one drive and it seems to do the trick... now to just get the rest of the lists in!

 

I would also like to do that with networked printers, I presume it will be that simple, too?!

Posted (edited)

I would also put a persistent tag like below on the end of the drive mapping if you are using a batch file.

 

net use p: \\server\share /persistent:no

 

could be that drive letters are being left behind by previous users and the script is failing as the letter is still in use in the registry etc.

Edited by seanmh
Posted

Cool glad i could help, unfortunately printer scripting isn't quite as easy as there are lots of different ways to do it. We are lucky here because we are running Windows Server 2003 RC2 and i am using the Print Management tool that comes with it so i have no need to use scripts. But if you read this Wiki it gives you lots of different ways to use scripts to map printers.

 

http://www.edugeek.net/wiki/index.php/Scripting_Printer_Addition_Based_on_Location

 

good luck

 

Justin

 

_______________________________________________________________

 

"Thanks Justin, that's great. I have tested it with one drive and it seems to do the trick... now to just get the rest of the lists in!

 

I would also like to do that with networked printers, I presume it will be that simple, too?!"

Posted

You said you tested it with one drive and it worked fine, i take it since that post you have added the extra drives and now its failing again. Try removing all the drives and adding them back one at a time to see if it is a particular drive thats causing the problem. Then if you see what is different about that drive to the others it may give you some idea why its causing the problem.

Also just as a thought try enabling the "Run logon scripts syncronously" command in the computer configuration section of your GPO. Oh and make sure "Run logon scripts Asyncronously" is not enabled.

It may slow down your users logon a bit but it will ensure that all scripts are executed.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...