none
Vista - Network drive mapping script do not work anymore

    Question

  • Hi,

    I have a very strange situation. My computer has Vista Business SP1 installed. We have a Windows AD domain.
    We have 2 samba servers integrated in AD: one Samba 3.0.24 on Fedora core 6; one 3.0.25 on SUN solaris 10 SPARC without zones (built to replace the fedora one).
    Samba configuration files are mostly the same since we replicated the same shares. Same kerberos configuration on both servers.
    To map network drives I'm using a script file that uses WScript.Network object and MapNetworkdrive method to map the shares based on IP address. The script is declared in the AD user account profile -> logon script. The script maps samba shares (10) and windows shares (5 on windows 2003 SE servers). I have a copy that maps the shares on old system and one where I changed the IP address of the samba server to the new one (3.0.25).
    The script is similar to this code:

    Option Explicit
    On Error Resume Next

    Dim wshNetwork, wshShell, wshSysEnv, colDrives, nReturnCode
    Dim i, strDrive, strShare, driveExists

    Set wshNetwork = WScript.CreateObject("WScript.Network")

      wshNetwork.MapNetworkDrive "h:", "\\samba.ip.address\share1"
      wshNetwork.MapNetworkDrive "i:", "\\samba.ip.address\share2"
      wshNetwork.MapNetworkDrive "j:", "\\samba.ip.address\share3"
      wshNetwork.MapNetworkDrive "k:", "\\windows1.ip.address\share4"
      wshNetwork.MapNetworkDrive "l:", "\\samba.ip.address\share5"
      wshNetwork.MapNetworkDrive "m:", "\\windows2.ip.address\share6"
      wshNetwork.MapNetworkDrive "n:", "\\samba.ip.address\share7"

    Set colDrives = WshNetwork.EnumNetworkDrives
    driveExists = "no"
    For i = 0 to colDrives.Count - 1 Step 2
        if colDrives.Item(i) = "P:" then
            driveExists = "yes"
            Exit For
        end if
            'WScript.Echo "Drive " & colDrives.Item(i) & " = " & colDrives.Item(i+1)
    Next


    'WScript.Echo driveExists

    if driveExists = "no" then
        'WScript.Echo "Mapping p:"
        wshNetwork.MapNetworkDrive "p:", "\\samba.ip.address\" & WshNetwork.UserName
    end if


    Set colDrives = Nothing
    Set wshNetwork = Nothing
    WScript.Quit(nReturnCode)


    On the samba 3.0.24 I'm able to map the drives using the IP address through the old script, I can access the drives in the network explorer window on server IP address.
    On the new samba 3.0.25 the new script doesn't work anymore and doesn't map either new samba shares or windows shares. I still can access the shares in the network explorer window based on the servers IP addreses.
    The error description I get is "The network path was not found.
    I did the changes in the Local policies for the "Security.Lan Manager authentication level:Send LM & NTLM - use NTLMv2 session security if negotiated" and had no effect.
    I forced the NTLMv2 in the new samba configuration without any effect on the script.
    Tried running the script "As administrator" - no effect.
    It might be a coincidence but in the same time with switching the file servers I applied Vista latest updates which might interfere with the script behaviour.
    I don't think is a firewall issue since I can access the shares through the explorer and the script works for the old samba server.

    To summarize: the mapping script doesn't work anymore; I can browse the shares in explorer using the server IP address and I can map the drives using the right click and drop down menu in explorer.

    Any ideas?

    Thank you,

    Catalin
    Wednesday, August 05, 2009 10:32 PM

All replies

  • I tried this in my Windows 7 install and it resolved my problem with mapping network drives.

    To get around this:
        1.    open the Control Panel
        2.    Switch to "small icon" view
        3.    Double-click Administration Tools
        4.    Double-click Local Security Policy
        5.    Or Secpol.msc
        6.    Expand "Local Policies" and select "Security Options"
        7.    Alternate : Type secpol.msc to get editor up then
        8.    Locate "Network Security: LAN Manager Authentication Level" in the list and double-click it.
        9.    Change the setting from "Send NTMLv2 response only" to "Send LM & NTLM - use NTLMv2 session if negotiated"
        10.    Network Security: Minimum session security for NTLM SSP Based (including secure RPC) Clients
        11.    Change the setting from "require 128 bit" to unchecked (No Minimum)
        12.    Click OK

    • Proposed As Answer by dnegrich Wednesday, January 14, 2009 11:06 PM adapted by nshadow to fit Windows 7

    • Proposed as answer by nshadow Tuesday, December 22, 2009 8:25 PM
    Tuesday, December 22, 2009 8:22 PM
  • I tried this in my Windows 7 install and it resolved my problem with mapping network drives.

    To get around this:
        1.    open the Control Panel
        2.    Switch to "small icon" view
        3.    Double-click Administration Tools
        4.    Double-click Local Security Policy
        5.    Or Secpol.msc
        6.    Expand "Local Policies" and select "Security Options"
        7.    Alternate : Type secpol.msc to get editor up then
        8.    Locate "Network Security: LAN Manager Authentication Level" in the list and double-click it.
        9.    Change the setting from "Send NTMLv2 response only" to "Send LM & NTLM - use NTLMv2 session if negotiated"
        10.    Network Security: Minimum session security for NTLM SSP Based (including secure RPC) Clients
        11.    Change the setting from "require 128 bit" to unchecked (No Minimum)
        12.    Click OK

    • Proposed As Answer by dnegrich Wednesday, January 14, 2009 11:06 PM adapted by nshadow to fit Windows 7

    Hi,

    How about for Windows Vista? Are the settings the same? 

    Thanks!

    Sunday, October 20, 2013 10:00 AM