# Windows 2008 VB logon script map drive by group membership

Hello,

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 wshNetwork.MapNetworkDrive "J:","\\njfile\finance" ElseIf InStr(strGroups, IT_GROUP) Then wshNetwork.MapNetworkDrive "J:","\\njfile\it$\"

End If
VB ScriptMicrosoft Server OSWindows Server 2008

Last Comment
serverbob

8/22/2022 - Mon
Kent Dyer

Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
SOLUTION
netballi

Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
SOLUTION
Get an unlimited membership to EE for less than $4 a week. Unlimited question asking, solutions, articles and more. SOLUTION Log in to continue reading Get an unlimited membership to EE for less than$4 a week.