Windows 7 will not connecting to Network Drive …
March 22, 2015WINSXS folder cleanup for Windows 7 and Server 2008 R2
March 22, 2015Source Code
Important Note: This script has not been checked by Spiceworks. Please understand the risks before using it.
”start script
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")
''find user name
strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)
''find user group''s
For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN
'' if user member of a group then map network drive
Select Case strGroupName
Case "GROUP NAME 1"
objNetwork.MapNetworkDrive "DRIVE LETTER:", "NETWORK PATH"
Case "GROUP NAME 2"
objNetwork.MapNetworkDrive "DRIVE LETTER:", "NETWORK PATH"
Case "GROUP NAME 3"
objNetwork.MapNetworkDrive "DRIVE LETTER:", "NETWORK PATH"
''
End Select
Next
''end script