Advertisement

05.14.2008 at 01:57PM PDT, ID: 23403130
[x]
Attachment Details

Logon script to map network drive doesn't work

Asked by magicspringsadmin in VB Script, Active Directory

Tags: Microsoft, Scripting

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.20.250"
strNewName="Network Share"

'Map the drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

'Name the drive
Set objShell=CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name=strNewName

Wscript.Echo "The shared folder has been mapped to " & strDriveLetter & " and named " & strNewName

wScript.Quit
**************************************

Any pointers?Start Free Trial
[+][-]05.14.2008 at 02:16PM PDT, ID: 21568811

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, Active Directory
Tags: Microsoft, Scripting
Sign Up Now!
Solution Provided By: oBdA
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.14.2008 at 02:37PM PDT, ID: 21568968

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 02:48PM PDT, ID: 21569029

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 09:21AM PDT, ID: 21575343

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 09:45AM PDT, ID: 21575653

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628