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 enforce  


On 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 "P:", \\SRV3\res_photos
            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

Popular posts from this blog