I have this script, which was, to my knowledge mapping drives correctly on Friday, and now it is not working. It maps my general drives but not the drives for the group users. If someone could help i would be more than grateful, it is a big issue today >.<
Here is the script
_______________________________________________________
**********************************************************************************
' ********************************* SCRIPT START **********************************
On Error Resume Next
Dim objNetwork, objUser, CurrentUser
Dim strGroup
Dim objFSO, objFILE, objShell
Const Administrators = "cn=administrators"
Const Gymcode = "cn=gymcode"
Const Waseya_House = "cn=waseya"
Const Medical_Report = "cn=mreport"
Const Inventory = "cn=inventory"
Const IFormula = "cn=iformula"
Const Vaxin = "cn=vaxin"
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
set objFSO=CreateObject("Scripting.FileSystemObject")
set objShell=CreateObject("Wscript.Shell")
strWelcomeMsg="Welcome to the Health Centre secure network."
strHelpMsg="Contact the technician for further assistance."
iErrorTimeout=10
blnShowError=True
If isarray(CurrentUser.Memberof) then
strgroup = LCase(Join(CurrentUser.memberof))
Else
strgroup = LCase(CurrentUser.Memberof)
End If
' ******************************** GENERAL MAPPING ********************************
objNetwork.MapNetworkDrive "P:", "\\server\public"
objNetwork.MapNetworkDrive "X:", "\\server\" & objNetwork.UserName & "$"
objNetwork.MapNetworkDrive "I:", "\\server\installer$"
' **************************** GROUP MEMBERSHIP MAPPING ****************************
If InStr(strGroup, Administrators) Then
objNetwork.MapNetworkDrive "W:", "\\server\adm$"
End If
' **********************************************************************************
If InStr(strGroup, Gymcode) Then
objNetwork.MapNetworkDrive "V:", "\\server\gymcode$"
End If
' **********************************************************************************
If InStr(strGroup, Waseya_House) Then
objNetwork.MapNetworkDrive "S:", "\\server\waseya$"
End If
' **********************************************************************************
If InStr(strGroup, Medical_Report) Then
objNetwork.MapNetworkDrive "R:", "\\server\mreport$"
End If
' **********************************************************************************
If InStr(strGroup, Inventory) Then
objNetwork.MapNetworkDrive "T:", "\\server\inventory$"
End If
' **********************************************************************************
If InStr(strGroup, IFormula) Then
objNetwork.MapNetworkDrive "U:", "\\server\iformula$"
End If
' **********************************************************************************
If InStr(strGroup, Vaxin) Then
objNetwork.MapNetworkDrive "Q:", "\\server\apps"
End If
' ******************************** SUMMARY MESSAGE ********************************
iDisplayTimeout=8
strMsg=""
strMsg=strMsg & strWelcomeMsg & VbCrLf
strMsg=strMsg & vbcrlf
strMsg=strMsg & vbcrlf
Set objDrives = objNetwork.EnumNetworkDrives
strMsg=strMsg & "Network drive mappings:" & vbcrlf
For i = 0 to objDrives.Count - 1 Step 2
strMsg=strMsg & "Drive " & objDrives.Item(i) & "=" & objDrives.Item(i+1) & vbcrlf
Next
strMsg=strMsg & vbcrlf
If strMsg<>"" Then objShell.Popup strMsg,iDisplayTimeout,"Network Drive Summary",vbOKOnly+vbInformation
' **********************************************************************************
wscript.end
Here is the script
_______________________________________________________
**********************************************************************************
' ********************************* SCRIPT START **********************************
On Error Resume Next
Dim objNetwork, objUser, CurrentUser
Dim strGroup
Dim objFSO, objFILE, objShell
Const Administrators = "cn=administrators"
Const Gymcode = "cn=gymcode"
Const Waseya_House = "cn=waseya"
Const Medical_Report = "cn=mreport"
Const Inventory = "cn=inventory"
Const IFormula = "cn=iformula"
Const Vaxin = "cn=vaxin"
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
set objFSO=CreateObject("Scripting.FileSystemObject")
set objShell=CreateObject("Wscript.Shell")
strWelcomeMsg="Welcome to the Health Centre secure network."
strHelpMsg="Contact the technician for further assistance."
iErrorTimeout=10
blnShowError=True
If isarray(CurrentUser.Memberof) then
strgroup = LCase(Join(CurrentUser.memberof))
Else
strgroup = LCase(CurrentUser.Memberof)
End If
' ******************************** GENERAL MAPPING ********************************
objNetwork.MapNetworkDrive "P:", "\\server\public"
objNetwork.MapNetworkDrive "X:", "\\server\" & objNetwork.UserName & "$"
objNetwork.MapNetworkDrive "I:", "\\server\installer$"
' **************************** GROUP MEMBERSHIP MAPPING ****************************
If InStr(strGroup, Administrators) Then
objNetwork.MapNetworkDrive "W:", "\\server\adm$"
End If
' **********************************************************************************
If InStr(strGroup, Gymcode) Then
objNetwork.MapNetworkDrive "V:", "\\server\gymcode$"
End If
' **********************************************************************************
If InStr(strGroup, Waseya_House) Then
objNetwork.MapNetworkDrive "S:", "\\server\waseya$"
End If
' **********************************************************************************
If InStr(strGroup, Medical_Report) Then
objNetwork.MapNetworkDrive "R:", "\\server\mreport$"
End If
' **********************************************************************************
If InStr(strGroup, Inventory) Then
objNetwork.MapNetworkDrive "T:", "\\server\inventory$"
End If
' **********************************************************************************
If InStr(strGroup, IFormula) Then
objNetwork.MapNetworkDrive "U:", "\\server\iformula$"
End If
' **********************************************************************************
If InStr(strGroup, Vaxin) Then
objNetwork.MapNetworkDrive "Q:", "\\server\apps"
End If
' ******************************** SUMMARY MESSAGE ********************************
iDisplayTimeout=8
strMsg=""
strMsg=strMsg & strWelcomeMsg & VbCrLf
strMsg=strMsg & vbcrlf
strMsg=strMsg & vbcrlf
Set objDrives = objNetwork.EnumNetworkDrives
strMsg=strMsg & "Network drive mappings:" & vbcrlf
For i = 0 to objDrives.Count - 1 Step 2
strMsg=strMsg & "Drive " & objDrives.Item(i) & "=" & objDrives.Item(i+1) & vbcrlf
Next
strMsg=strMsg & vbcrlf
If strMsg<>"" Then objShell.Popup strMsg,iDisplayTimeout,"Network Drive Summary",vbOKOnly+vbInformation
' **********************************************************************************
wscript.end