Login script not working correctly

From: Elizabeth (lizzard_at_news.postalias)
Date: 10/07/04


Date: Thu, 7 Oct 2004 13:13:31 -0700

I can get the logon script to run as long as I omit the
group authority checking portion of it. Any idea?

' VBScript to map different groups to different shares.
Option Explicit
' Dim objNetwork, objUser
Dim strGroup,objUser
Dim DriveLetter1, DriveLetter2, DriveLetter3, DriveLetter4
Dim RemotePath1, RemotePath2, RemotePath3, RemotePath4,
RemotePath5
Dim strUserName, objNetwork, CurrentUser
'** Most of the Const statement point to active directory
user groups **
' Const Accounting = "cn=Accounting"
' Const Admin = "cn=Admin"
' Const Citrix_Users = "CitrixGang"
Const Engineer = "cn=Engineer"
' Const Manufactures = "cn=Mfg"
Const hr = "cn=hr"
Const ITGrp = "cn=IT"
' Const Marketing = "cn=Marketing"
' Const Office-Services = "Office"
' Const Sales = "cn=Sales"
' Const Domain_Users = "cn=Everyone"
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
' m: reserve for home paths '
' n: reserve for public spaces '
' o: reserve for department home spaces '
' p: reserve for additional department home spaces
access '
' Drives Letters must be in all CAPS
DriveLetter1 = "M:"
DriveLetter2 = "N:"
DriveLetter3 = "O:"
DriveLetter4 = "P:"
RemotePath1 = "\\FileServer1\Users$\"
RemotePath2 = "\\FileServer1\public\"
RemotePath3 = "\\FileServer2\Groupshares\IT\"
RemotePath4 = "\\FileServer2\Groupshares\Engineering\"
RemotePath5 = "\\FileServer1\groupshares\admin\"
strUserName = objNetwork.UserName
strUserName = strUserName & "$"
strGroup = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroup, Engineer) Then
WScript.Echo "Engineers "
objNetwork.MapNetworkDrive DriveLetter3, RemotePath4
ElseIf InStr(strGroup, ITGrp) Then
WScript.Echo " IT Admins "
objNetwork.MapNetworkDrive DriveLetter1, RemotePath1 _
& strUserName
objNetwork.MapNetworkDrive DriveLetter3, RemotePath1
objNetwork.MapNetworkDrive DriveLetter1, RemotePath3
'ElseIf InStr(strGroup, Accounting) Then
'WScript.Echo " Accounting"
' objNetwork.MapNetworkDrive "v:", "\\FileServer2
\Users$\"_
' & objNetwork.UserName
' objNetwork.MapNetworkDrive "u:", "\\FileServer2
\GroupShares\Accounting\"
'ElseIf InStr(strGroup, Administrators_Group) Then
'WScript.Echo "Administrative Assistants " & strGroup
' objNetwork.MapNetworkDrive "v:", "\\FileServer2
\Users$\"_
' & objNetwork.UserName
' objNetwork.MapNetworkDrive "u:", "\\FileServer2
\GroupShares\Admin\"
End If
'Wscript.Echo "Mapped drives " & DriveLetter1 & " , " &
DriveLetter2 & " , "_
' & DriveLetter3 & " , " & DriveLetter4
WScript.Quit
' End of Script.

.