![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Retrieving Security Group and Username from a VPN Connection I'm trying to map network drives according to username and security group over a VPN. I've put together a script that will map drives if the computer is part of the domain, but it doesn't work for obvious reasons on computers connected over a VPN. Is there a way to retrieve an user's Active Directory information from a VPN connection using Cisco Systems VPN Client Version 5.0.02.0090? I've gone through page after page and I still haven't found the exact solution. Any help will be greatly appreciated, thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Retrieving Security Group and Username from a VPN Connection On Feb 4, 1:16*pm, jimmysjams <jimmysj...@xxxxxx> wrote: Quote: > I'm trying to map network drives according to username and security > group over a VPN. *I've put together a script that will map drives if > the computer is part of the domain, but it doesn't work for obvious > reasons on computers connected over a VPN. *Is there a way to retrieve > an user's Active Directory information from a VPN connection using > Cisco Systems VPN Client Version 5.0.02.0090? > > I've gone through page after page and I still haven't found the exact > solution. *Any help will be greatly appreciated, thanks in advance. logging in is easy compared to the rest of the tasks. Sub MapDrivesForUser(userName, password) Const ADS_NAME_INITTYPE_GC = 3 Const ADS_NAME_TYPE_NT4 = 3 Const ADS_NAME_TYPE_1779 = 1 Dim objUser Dim dictionaryGroups Dim objFSO Dim strDomain Dim objTrans Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTrans = CreateObject("NameTranslate") Set objNetwork = CreateObject("WScript.Network") strDomain = "DOMAIN" strNTName = strDomain & "\" & userName objTrans.InitEx ADS_NAME_INITTYPE_GC, "", userName, strDomain, password objTrans.Set ADS_NAME_TYPE_NT4, strNTName strUserDN = objTrans.Get(ADS_NAME_TYPE_1779) strUserDN = Replace(strUserDN, "/", "\/") Set objDSObj = GetObject("LDAP:") Set objUser = objDSObj.OpenDSObject("LDAP://domain.com/" & strUserDN, strNTName, strPassword, ADS_SECURE_AUTHENTICATION or ADS_SERVER_BIND) Set dictionaryGroups = BuildDriveDictionary(userName) On Error Resume Next For Each oGroup in objUser.Groups groupName = UCase(Right(oGroup.Name,Len(oGroup.Name)-3)) If dictionaryGroups.Exists(groupName) Then Set dictItem = dictionaryGroups.Item(groupName) For Each key in dictItem.Keys If objFSO.DriveExists(key) Then objNetwork.RemoveNetworkDrive(key) End If objNetwork.MapNetworkDrive key, dictItem.Item(key) Next End If Next End Sub |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| how do i check for Security Group vs Distribution Group ? | PowerShell | |||
| add user to group /group scope - Global /Group type - Security | PowerShell | |||
| Get username/group membership from another forest? | VB Script | |||
| Group By Type - The [username] Folder | Vista file management | |||