I have a user johndoe with the following drive mapping in his login script (.bat file).
net use y: \\myserver\users$\johndoe
However, when I try to use a more generic mapping using the username variable the Y drive maps to \filesvr\users i.e. it seems to ignore or not be able to look up the user name.
net use y: \\myserver\users$\%username% /persistent:yes
I checked that the user has sufficient permissions on his home directory and that the drive is not already mapped.
The user is logging on to a desktop from home using VPN and RDP.
Any idea why this is and how to get around it?
Best Answer
Try checking what %username% maps to on the local machine. If you're logging into the desktop on your local workstation as "bill" then %username% will be "bill". If Bill's login is "bjohnson" then %username% will still be "bill" and not "bjohnson".