On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network"
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 "Security group name"
objNetwork.MapNetworkDrive AvailableDriveLetter,"
Case "Security Group name"
objNetwork.MapNetworkDrive AvailableDriveLetter, "Share Path"
End Select
Next
'-----------------------------
Function AvailableDriveLetter
With CreateObject("Scripting.
For i = Asc("D") To Asc("Z")
If Not .DriveExists(Chr(i)) Then
AvailableDriveLetter = Chr(i) & ":"
Exit For
End If
Next
End With
End Function
Any help is appreciated.