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?