How to map multiple network drives using a VBS script
A sample script files to map multiple drives mapping through a VBS script
Note:Use group policy management console to enforceOn Error Resume
Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")
Wscript.Echo strUser.UserName
strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)
For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN
Select Case strGroupName
Case "Domain Users"
objNetwork.MapNetworkDrive "t:", "\\srv3\data"
objNetwork.MapNetworkDrive "u:", "\\srv3\Filing_Data_Shed"
Case "Buderim_Admin"
objNetwork.MapNetworkDrive "Y:", "\\SRV3\\adminscan"
Case "Buderim_shared"
End Select
Next
Comments
Post a Comment