?
Solved

VBScript hang at logoff with split tunnel vpn

Posted on 2006-04-18
7
Medium Priority
?
533 Views
Last Modified: 2012-08-13
I am troubleshooting a hang on a vbscript whichs runs at logoff when using a split-tunnel Cisco SSL vpn on a Windows Server 2003 domain.  The script loops through all possible mapped network drives (letters O through Z), enumerating and disconnecting the drives if mapped.  I use Cisco PIX Firewall, with both Cisco VPN client software and web-based SSL vpn.  The SSL vpn has split tunneling enabled so some lab machines can be reached.  I have enabled in Group Policy the Maximum Time to Wait for Scripts and set it to 45 seconds before ending the logoff.  This solves the problem of having remote users wait up to 10 minutes (600 second default before forcing logoff) to shut down their machines properly.  This hang happens with the ssl vpn connected or disconnected when the user logs off, but does not happen when using the vpn client (no split tunnel) in the same scenario.  Any ideas?

Thanks,
Jason
0
Comment
Question by:jcain103
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:mcsween
ID: 16480180
Can you please post the function that removes the drive?  I'm thinking you may have to force it closed due to hanging open files.
0
 

Author Comment

by:jcain103
ID: 16480613
Set obj_Network = WScript.CreateObject("WScript.Network")
Set obj_FSO = CreateObject("Scripting.FileSystemObject")

      for i = 79 to 84
      ' If the drive letter is already in use then disconnect the drive
            If obj_FSO.DriveExists ( Chr(i)&":" ) Then
                  obj_Network.RemoveNetworkDrive Chr(i)&":"
            End If
      next
'we map the X drive as the user's home, thus skipping 85
for i = 86 to 90
      ' If the drive letter is already in use then disconnect the drive
            If obj_FSO.DriveExists ( Chr(i)&":" ) Then
                  obj_Network.RemoveNetworkDrive Chr(i)&":"
            End If
      next

 'Cleanup
Set obj_Network = Nothing
Set obj_FSO = Nothing

wscript.quit
0
 
LVL 22

Accepted Solution

by:
mcsween earned 2000 total points
ID: 16481811
Try to change the line
obj_Network.RemoveNetworkDrive Chr(i)&":"

to:
obj_Network.RemoveNetworkDrive Chr(i)&":" True,True

1st true will force, second will update their profile to make sure it doesn't try to map at next logon unless mapped by a script.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 22

Expert Comment

by:mcsween
ID: 16481871
You could also use a bit simpler of a script to do this, but I don't think that's your real issue...this will unmap all network drives except "x:"


Set obj_Network = WScript.CreateObject("WScript.Network")
Set odrives = wNetwork.EnumNetworkDrives

For i = 1 To odrives.Count - 1 Step 2
      If Not odrives.Item(i-1) = "X:" Then
              obj_Network.RemoveNetworkDrive odrives.Item(i-1),True,True
        End If

Next
0
 

Author Comment

by:jcain103
ID: 16481941
Didn't consider forcing the removal of the mapped drive.  As for the hanging open files, do you mean opened on the client's machine (e.g. my laptop while testing) from the mapped network share?  It hangs with or without ever exploring or opening the network share or any files on it.  I am almost positive it has something to do with the split vpn tunnel, that was my original reason for the post.  Will have to test this after hours and let you know.  (forgot that 85 is U, not X :)
0
 
LVL 22

Expert Comment

by:mcsween
ID: 16482054
Is this all the script does, or does it have some more functions in it?
0
 

Author Comment

by:jcain103
ID: 16482128
That's the entire script.  Only other script is run at login to map the drives.  If I am at home, I have to start the vpn after I login to my machine to get on the network, thus the drives are never mapped.  I just looked at the 4 GPO's that are in place for this macine, and for me as a user - the code above is the only logoff scripting to remove mapped drives.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question