Link to home
Start Free TrialLog in
Avatar of dylanites
dylanites

asked on

drive mappings using net use

Hi

I am trying to redo login script because when this user changed his password (as per the security settings) and logged in, he cannot connect to his mapped drives but instead has to re-enter his password.

Here is the script that someone else wrote

net use s: \\servername\foldername
net use u: \\servername\foldername
net use x: \\servername\foldername
net use h: \\servername\%username%$
w32tm /config /manualpeerlist:ntp3.sf-bay.org /syncfromflags:manual
w32tm /register
w32tm /resync /nowait

My guess why this might be happening is because the drives should be deleted (persistent:no) before being remapped. My question is what does net use h: \\servername\%username%$ mean? Also what does the w32tm.... mean?

If I had to do this I would simply write net use /persistent:no net use s: /delete and so on.

I am not very confident in this stuff, so any help would be greatly appreciate.

Thank you
Avatar of maxis2cute
maxis2cute

wm32 is the command to set the time on the computer to whatever is set in group policy. In this case the first line will set it to ntp-Network time protocol. the time server is sf-bay.org.  The second registers it and the third resyncs the time.

the %username% is correct to set it for the current user but the $ i dont know why itis used.
http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=HPND,HPND:2007-27,HPND:en&q=%25username%25%24

Avatar of btassure
The $ indicates that it is a hidden share. If you browse to that location you will not see that folder as being shared in the directory and is only accessible by typing the address directly.
net use s: \\servername\foldername
net use u: \\servername\foldername
net use x: \\servername\foldername

The above mappings are proper.

net use h: \\servername\%username%$

The above mapping may not be working, the $ may have been a typo when first entered it should only contain %username%, anytime you see a variable encased in % signs it tells the OS to look in the user environment and get the variable specified between the % signs. This can be viewed by opening a dos prompt and typing set, this will list these variables.

w32tm /config /manualpeerlist:ntp3.sf-bay.org /syncfromflags:manual
w32tm /register
w32tm /resync /nowait

The above lines sets the windows time service on each station when they login, specifies the source to go to to sync the time on the workstation, it really only has to be run once, but running each time you login would probably not hurt, considering new stations are probably added occasionally.
And personally I prefer to delete the mappings before reusing them, though making them not persistent is not really necessary as you are wiping them manually.
btassure,

good call on the $ symbol, I didn't even think of that.
I did not even think that they would hide a user share, i would just share only to that user and domain admin and the same with file permissions.

Avatar of dylanites

ASKER

So just to be sure, I should keep the entire script the same, except on the top few lines include net use s /delete and so on to delete the mappings and have them mapped again. I won't explicitly state persistent:no

Also, just out of curioisty is it best practice to include %username%, it seems to me that there is no need for it (especially since all the users who are logging into the domain are getting the same mapped drives).

Thank you
Without the %username%$ it won't know how to map the user directory, if that's what you want to do.
Okay, so instead of using the home folder option in AD, this person used the %username% in the script?
Thanks
Perhaps the $ wouldn't work in AD, so he elected to use the login script, just a guess, could be wrong.
ASKER CERTIFIED SOLUTION
Avatar of StuFox100
StuFox100
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Probably good to note at this point that the following command will set the workstation clock to the server without using the time service.

net time \\servername /set /yes