Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping Drives

Status
Not open for further replies.

moochoouk

IS-IT--Management
Nov 23, 2007
5
GB
I am trying to map a particular network drive to a suite of machines

i have an OU called room70, which contains all the computer in that room.

i have created a GPO for this group that maps a drive under computer management, startup scripts.

the script is a simple net use command.

however nothing in the OU room70 is able to map this drive. Im sure im doing something obvious wrong can someone point me in the right direction
 
I've had trouble using net use in a startup script before, this VB script works for me as a startup script i'd give it a try. Run it manually first to make sure then pop it in netlogon and see if it maps at startup.

Code:
Set WSHNetwork = CreateObject("WScript.Network")

Set objNetwork = Wscript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "M:", "\\server\share"

set WSHNetwork = Nothing

wscript.quit
 
i tried this and unfortunately i get the same problem it does not map.

running the script manually maps the drive same as it did with net use.

its almost like the script just does not run. running a gpresult shows that the GPO is being picked up. so i am at a total loss to why the script does not run
 
The policy isn't being picked up at all? Have you tried setting anything else in that policy or enforcing it?
 
running a GPresult actually shows the GPO is there. so its definately seeing it upon logon. just the startup script does not run.


 
What share permissions do you have set on the share?

If you set another setting in the computer policy does that take effect?
 
the permissions are set to everyone read/write. just so i could test it was mapping.

adding something else to the GPO does actually work. i disable the connections settings in IE and it was enforced on all machines in the OU
 
Are these XP machines? If so have you got the 'Always wait for the network at computer startup and logon' setting enabled?
 
just enabled that and it made no difference.

i am appreciating all this help though
 
Give it a couple of reboots it's an odd setting and takes a couple of runs to apply.

Do you see any erros in the event log at startup?
 
Check licencing, too. If the server has the maximum number of connections already filled - if you are on per server licencing - then the mapping will fail...
 
For a test, create a share on one of the workstations in that OU and try mapping to that share from another machine in the OU.

You can also try getting error information like this:

Code:
On Error Resume Next
Set WSHNetwork = CreateObject("WScript.Network")
WSHNetwork.MapNetworkDrive "P:", [red]"\\server\share"[/red]
If Err.Number <> 0 Then
   MsgBox("Error mapping drive.  Error #:" & Err.Number _ 
           & " Error Description:" & Err.Description)
End If
Set WSHNetwork = Nothing
Wscript.Quit

Save the above code to a text file and give it a VBS extension. Then just double click it to execute. You must change the part in [RED]red[/RED].

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top