Thursday, March 1, 2007

Network Drives not updating

For users that do not have a mandatory profile when they run the stafflogon script that among other things connects the network drives they get the error

"The local device name is already in use"

For the most part this does not matter beacuse the network drives do not change. What happens though if you change a server or change the UNC for a drive.

A solution to this problem may be to have a script run at logoff or shutdown that disconnects the drives.

Try something different first.

Copied the existing logon script to cw.bat

added the line

net use /persistent:no at the end of the script

Changed logon script in profile for teacher to cw.bat.

Test Case 1:

Log on to a user that already has the incorrect drives mapped. Those mapped to the old servers.
Check they do have the incorrect drives.

logoff the user and change their logon script to cw.

See what happens.

This does not work. I think the reason is because the drives were connected previously with, by default, persistence = yes. Hence they will have to be deleted initially. You could eventually remove the delete connections text from the script because the connections would not be persistent.

Add the delete connections text to the cw script.

This works a treat.

When you have the user logon a second time and hence the logon script is run again the delete drives text fails be cause the drives are no longer persistent and hence are not there. This is a quick process and will not cause any problems.

I have not changed the users home directory mapping. (net use h: /home) This receives its connection string from the Active Directory. When we role over a server this is changed accordingly. This must be a special map i.e. it is not persistent otherwise you would think it would suffer from the original problem.

No comments: