I am using a VBA script assigned to a group in AD to try and map a drive. I see that the policy was applied when I run gpresult, but there is no drive mapped. Here is my code:
**************************
**********
**
'Filename: MapNetworkDrive.vba
'Maps network drive to UNC Path
'Modified from script written by Guy Thomas
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter="Z:"
strRemotePath="\\192.168.2
0.250"
strNewName="Network Share"
'Map the drive
Set objNetwork = CreateObject("WScript.Netw
ork")
objNetwork.MapNetworkDrive
strDriveLetter, strRemotePath
'Name the drive
Set objShell=CreateObject("She
ll.Applica
tion")
objShell.NameSpace(strDriv
eLetter).S
elf.Name=s
trNewName
Wscript.Echo "The shared folder has been mapped to " & strDriveLetter & " and named " & strNewName
wScript.Quit
**************************
**********
**
Any pointers?
Start Free Trial