remove wrong network drive by subnet
hello
i'm working in a company with a number of branches, each branch have a diffrent subnet : 10.172.30 , 10.172.40, 10.172.50
each branch have a local file server that the branch user is maped to him with a login script that do all the job.
i don't know how they worked until now but what happening if the user going to another remote branch is still getting the map drives
of his branch server, and that causing to a big slow down in both branches.
i want to write a vbscript that will remove the maped drive if the user is not in his original branch.
Example:
joe working in NY and getting mapped drives every login, joe is going to LA for a couple of hours and getting the network drives of ny, and causing a big slow down in the network.
how to write a script that can compare the unc or ip or server name in the maped drives to the subnet of the user and if is getting the wrong ones delete them ?
again all the maped drives go to a local server in the branch subnet.
the thing is i don't have an idea how the script will to the "math" and see that the subnet is not of the user.
i'm not a vbscript excpert so i will happy for help with code lines.
thanks
|