Hello,
Im quite sad on scripting so please keep that in mind while answering
My problem is that the script below gives a error (while running on windows 2000) :
line : 13
char : 1
error: Type mismatch : 'Join'
code : 800A000D
Source Microsoft VBScript runtime error
- it works fine in windows XP
- basically what im trying to do is to have a network drive mapped if logged on user belongs to group sharex_grp in Active Directory
Any help will be appriciated.
(please say if more information is needed about the envirnment...)
script is as follows:
Option Explicit
Dim strGroups
Dim wshNetwork
Dim CurrentUser
Dim ADSysInfo
Const sharex_grp = "cn=sharex_grp"
Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, sharex_grp) Then
'Map network drive
wshNetwork.MapNetworkDrive "Y:", "\\111.222.333.444\share\"
else
msgbox "you are not in the sharex group"
end if
Set strGroups = Nothing
Set wshNetwork = Nothing
Set CurrentUser = Nothing
Set ADSysInfo = Nothing
WScript.Quit
Im quite sad on scripting so please keep that in mind while answering
My problem is that the script below gives a error (while running on windows 2000) :
line : 13
char : 1
error: Type mismatch : 'Join'
code : 800A000D
Source Microsoft VBScript runtime error
- it works fine in windows XP
- basically what im trying to do is to have a network drive mapped if logged on user belongs to group sharex_grp in Active Directory
Any help will be appriciated.
(please say if more information is needed about the envirnment...)
script is as follows:
Option Explicit
Dim strGroups
Dim wshNetwork
Dim CurrentUser
Dim ADSysInfo
Const sharex_grp = "cn=sharex_grp"
Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, sharex_grp) Then
'Map network drive
wshNetwork.MapNetworkDrive "Y:", "\\111.222.333.444\share\"
else
msgbox "you are not in the sharex group"
end if
Set strGroups = Nothing
Set wshNetwork = Nothing
Set CurrentUser = Nothing
Set ADSysInfo = Nothing
WScript.Quit