Windows 2008 VB logon script map drive by group membership
Posted on 2013-01-04
I used a basic VB script I found on a microsoft site. The home directory part is working but the group membership mappings are not working. If anyone can tell me what Im doing wrong id appreciate it. Here is the script I used:
Const Finance_GROUP = "cn=SG_Finance"
Const IT_GROUP = "CN=SG_IT"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:","\\njfile\us$\" & wshNetwork.UserName
Set adSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, finance_GROUP) Then
ElseIf InStr(strGroups, IT_GROUP) Then