General discussion

Locked

Mapping Network Drives over VPN

By neora_x_m ·
Hi,

I got into this new job.In fact, you can all it my first job in the field. I understand VPN, firewalls, router, etc at CCSP level( trained in Network Security..as you can guess). But I'm not really good at Systems. This new job is mainly systems administration and i took this up so that i'll have some exposure. Dunno if i'm in the ryt track.
Anyways, i have this problem.

I have Win2k3 servers and WinXP clients. Netgear gateway. A small office set up.

The Scenario:

The laptop(WinXP) has network drives mapped to the file server. It works fine when connected locally to the LAN. The home drive of the user is made available offline so that he can use the data when he goes back home. Whenever he comes back to office network the drives synchronize.

Now I had to configure the VPN in the netgear box(which does not give me much choices other than click some radio buttons and enter IP addresses). Anyways, the laptop can successfully connect to the VPN. It can also ping the IPs of the servers in the LAN.

The problem:

When the laptop is remotely connected thru VPN the network drives are not automatically reconnected. When they are removed and mapped again using the UNC paths it works. So i read a lot about it everywhere and came to realise that we need to remap the drives using script. So i managed to write a VB script which would remove the maps first and remap them. The script worked fine. But realized that to actually access the map drives the user needed to log on to the file server( which is also a DC) first by giving the UNC path in the run, before running the script. And the need to do that is also not consistant.I also tried a bat file with net use.

This would be too complicated for other non-technical users. Could somebody please guide me in the proper direction because i think i'm learning the stuff the hard way.

I know this post is too long, but i wasnt sure how i would explain this stuff. If i'm not clear please ask me what more u need to know.

Thanks in advance.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Anybody

by neora_x_m In reply to Mapping Network Drives ov ...

If anybody knows a solution or work around for this it will greatly appreciated. This is a humble request from a novice.

Thank you all in advance.

Collapse -

Idea - Workaround for now

by NOW LEFT TR In reply to Mapping Network Drives ov ...

The drives are connected at logon time, yes.

Is the VPN active as the user logs on, or after such time. If it is after create a logon.vbs file on the desktop, instucting the user to run once the VPN is established.

Collapse -

Thanks

by neora_x_m In reply to Idea - Workaround for now

Thanks a lot for replying. Could you please point me to a good document for VB scripts? I'm learning as I go.

As you said this is a work around for now. What do other people in the industry really do for such a problem? Or is it my own problem??

The user connects to the VPN after logging into the local computer. That's the same as the Netword credentials. Network user is also a local user in that laptop.

Hmmmm logon.vbs should solve it atleast for now. Now i've given the user only a remap.vbs. I should be able to add the logon part to that and then do the remap ryt?

Thanks a lot once again.

Collapse -

Sample script I'm using

by gpastorelli In reply to Idea - Workaround for now

I'm not VBScripting expert, but here is one I'm using and it works like a charm.-

Dim WSHNetwork
Dim UserName

On Error Resume Next

Set WSHNetwork = Wscript.CreateObject("WScript.Network")

'This is important, the script won't run properly if a drive is being mapped to an already mapped drive
'so just remove any drives that you plan on mapping in this script

Set colDrives = WSHNetwork.EnumNetworkDrives
For i = 0 to colDrives.Count -1 Step 2
Select Case colDrives.Item(i)
Case "F:"
WSHNetwork.RemoveNetworkDrive "F:"
Case "S:"
WSHNetwork.RemoveNetworkDrive "S:"
End Select
Next

'Username stores the username for the logged in user
'works well for scripts that must map to a user folder named after that user

UserName = WSHNetwork.UserName

'Pretty self-explanatory,
'WSHNetwork.MapNetworkDrive
'Then the drive letter, "F:","\\SERVER\SHARE"


WSHNetwork.MapNetworkDrive "F:","\\PCB-MAIN\APPS"
WSHNetwork.MapNetworkDrive "S:","\\PCB-MAIN\USERS\" & UserName

Wscript.quit

Collapse -

Questions

by murshedz In reply to Sample script I'm using

Is the user logging on to the DC even though he/she is out of the company?

One solution is to check the box (XP) that says Log on using dial-up connection and choose the VPN connection.

Collapse -

nope

by neora_x_m In reply to Questions

Nope. The user's DC account is also made to be the local account so that the user can log on with the same credentials even when he's offline. When he goes home he logs on to the XP box using the DC credentials. But he logs on just locally. Then connects to the internet(broadband). Then he connects to the VPN manually thru a VPN client.

After that he has to remap the drives to actually use them. For that he needs to log on to the remote network. He gives the UNC of the file server in the explorer and sometimes he's prompted for a password and sometimes not.

After that he can run the remap.vbs and everything's fine. But if i have to set VPN connectivity for my non-technical user, this routine will be cumbersome. But still it's not stable. That's why i want to include the logon in the script so that they just have to double click on the file and get on with it.

Collapse -

try

by neora_x_m In reply to Sample script I'm using

Thank you Pastor. I'll try out the script and see if it works for me.... :)

Back to IT Employment Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums