Quantcast
Channel: Group Policy forum
Viewing all articles
Browse latest Browse all 19997

Can't map network drive on NAS via Group Policy

$
0
0

I want to map a drive to a share on our new NAS. We've always used Group Policy to map network shares that are actually on our Win2003 server. Here's the details...

-

-

Windows Server 2003 Standard SP2

Group Policy Management 1.0.2

Synology DS1813+ NAS (it joins our domain and integrates with Active Directory to grant rights)

The group policy VB Script is named map.vbs

Windows XP sp3 clients (that's all I've test. I haven't tested our Win7Pro clients yet)

-

-

Mapping Z: to \\server\data1 works 99.9% of the time

Mapping L: to \\nas\data2 works on SOME pc's and not on others (LOGGING IN AS THE SAME USER ON ALL PCs)

Here's the kicker. I can login and then MANUALLY run "map.vbs" on any computer and it maps all drives perfectly

-

-

Here's the script (map.vbs)...

-

Dim objNet

Set objNet = CreateObject("Wscript.Network")

' ********
' Map Z (the server share)
' *******
' Temporarily suspend normal error handling
On Error Resume Next
' Map drive
objNet.MapNetworkDrive "Z:" , "\\server\data1"
' Test for an error
If (Err.Number <> 0) Then
' Restore normal error handling
On Error GoTo 0
' Remove the drive mapping.
objNet.RemoveNetworkDrive "Z:" , True, True
' Map drive
objNet.MapNetworkDrive "Z:", "\\server\data1"
End If
' Restore normal error handling
On Error GoTo 0


' ********
' Map L (the NAS share)
' ********
' Temporarily suspend normal error handling
On Error Resume Next
' Map drive
objNet.MapNetworkDrive "L:" , "\\nas\data2"
' Test for an error
If (Err.Number <> 0) Then
' Restore normal error handling
On Error GoTo 0
' Remove the drive mapping.
objNet.RemoveNetworkDrive "L:" , True, True
' Map drive
objNet.MapNetworkDrive "L:", "\\nas\data2"
End If
' Restore normal error handling
On Error GoTo 0



WSCript.Quit

-

-

Thanks!


Viewing all articles
Browse latest Browse all 19997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>