cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2448
Views
0
Helpful
0
Replies

Cisco AnyConnect VBS Scripting OnConnect

swnorth99
Level 1
Level 1

           I have setup on the SSL VPN ASA scripts_OnConnect.vbs that maps the users P drive when users login via AnyConnect. This works fine. I have a request to run a file once a user logs in via Cisco AnyConnect.    It normally runs when a user is inside our network when they are logging in and goes to our auditserver1. I want to add this function to users logging in via VPN.

The windows command that runs when they are insaide the network is    Start  \\auditserver01\audit\scanner\AuditScanner.exe

I want to know how to write this to my scripts_OnConnect.vbs. I am not VBS scripting literate and would appreciate any help.

 

This is my current sciprts_onConnect.vbs that map the P drive to users accounts

'ON ERROR RESUME NEXT
'Err.Clear
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objShell = CreateObject("WScript.Shell")
objShell.LogEvent 0, "Sample AnyConnect OnConnect script."


Dim strDriveLetter, strRemotePath
strUName = WShNetwork.UserName
strDriveLetter = "P:"
strRemotePath = "\\server01\" & strUName

' add new mapping
wshNetwork.MapNetworkDrive strDriveLetter, strRemotePath

If Err.Number <> 0 Then
   objShell.LogEvent 0, "Failed to map network drive." & vbCrLf & Err.Number & ": " & Err.Description
End If

WScript.Quit

0 Replies 0