No announcement yet.

Mapped drive issue

  • Filter
  • Time
  • Show
Clear All
new posts

  • Mapped drive issue

    We run server 2003 and xp clients

    I'm having a problem with drive mapping on some pc's.

    When the pc is started up and logged onto by a user they are missing 3 mapped drives out of 4.
    If I use explorer to type in the unc \\servername\share i get an error stating: access to resource \\servername\share has been disallowed.

    If they log off and log back on all drives are available and stay that way until the pc is rebooted.

    Anyone have any idea's why.

  • #2
    Re: Mapped drive issue

    Copy and paste the actual error message, it will be more useful in determining what's going on.
    Goto the event viewer to get more details on the error.

    Make sure you don't have the $IPC share open under another account.

    Type "net use" at the cmd prompt and see what's listed. If you see another share open on that server, try disconnecting it (net use \\server\share /d) and running the script again.

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **


    • #3
      Re: Mapped drive issue

      The "disallowed" error you get when you use Windows Explorer to type in the UNC could have nothing to do with the mapped drive issue. Probably you have just disabled network browsing or disbled the RunBox or... <> for the users.

      you could give this a try:
      Use Group Policy at the computers OU or, at the domain level to set,
      Enable => Computer Configuration\Administrative Templates\System\Logon\Always wait for the network at computer startup and logon
      By default on Windows XP Professional computers, Group Policy processing does not wait for the network to start. This default behavior can be changed by this policy setting.

      It could also be caused by the logon script, specially when it is lauching other scripts/programs from within this logonscript. If the latter might be the case try:
      Disable! => Computer-or-User Configuration\Administrative Templates\System\Scripts\Run logon scripts synchronously
      (You might have to reboot the test computer twice)

      Are all 4 drive mappings connecting to just one same server?
      Can you show the logon script that directly is started by the GPO?

      Last edited by Rems; 16th October 2009, 14:54.

      This posting is provided "AS IS" with no warranties, and confers no rights.


      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts


      • #4
        Re: Mapped drive issue

        Thanks Rems.

        The always wait for network option is already enabled in GP.

        I'll test the Run logon scripts synchronously setting today .

        The missing drives are mapped to 2 different servers one a DC on a file server.

        Here is the login script that is running.

        Thanks for you time and help

        REM student.bat for all student logins - Amended & tidied-up (KAW 2009-03-30)

        REM Log the StartLogin message on the syslog server
        \\berlin\apps\others\syslog\klog -h -F user -L notice -M "StartLogin,%username%,%computername%"

        REM Login to websense
        \\berlin\apps\others\WS_Logon\LogonApp.exe /NOPERSIST

        REM Switch to 1024x768 res
        \\berlin\apps\programs\win2k\resswitch 1024 768 16 60

        REM Run PCounter wbalance program
        start \\berlin\apps\others\wbalance.exe

        REM Run the printers.vbs script to connect this workstation to its printers
        start \\wilberforce.local\netlogon\printers.vbs

        REM Delete any existing connections and reconnect and sleep for 1sec
        net use q: /delete /y
        net use q: \\berlin\apps
        \\berlin\apps\others\sleep 1

        net use p: /delete /y
        net use p: \\cairo\open
        \\berlin\apps\others\sleep 1

        net use b: /delete /y
        net use b: \\paris\studenthomesbackup$\%username%
        \\berlin\apps\others\sleep 1

        REM Registry settings
        \\berlin\apps\others\regperm /K "HKEY_CURRENT_USER\Control Panel\Desktop" /I /A:Wilberforce\STUDENT:R /D:Wilberforce\STUDENT:W
        reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings" /v WarnonBadCertRecving /t REG_DWORD /d 0 /f

        REM Log the StopLogin message on the syslog server
        \\berlin\apps\others\syslog\klog -h -F user -L notice -M "StopLogin,%username%,%computername%"


        • #5
          Re: Mapped drive issue

          My personal preference is to actually Enable "Run logon scripts synchronously" (and make sure to create a logonscript that can run like that), unless
          you *have to* start programs from within the script that need to run longer than the time the logonscript is running.

          For your batch (as it currently is) you definitely have to make sure "Run logon scripts synchronously" is Disabled.
          In your batch you use a few times the START command w/out switches, so it could occour that these programs (running sub processes) can take more time to finish than the time the batch is running.
          Therefore you better not run this logonscript synchronously with the chance of killing all sub processes launced by the script when the logonscript ends.

          If you use the START command to run exe-files consider to use the /wait (or /w) switch for those processes that run temporay!! during the logon process.
          The batch will then wait for the program to return before it continues the next statements.

          Depending on the type of program
          - use start without the /w switch to launch a new process and do not wait for its return.
          - Or, don't use START at all, the batch will probably wait for return.
          - Use START with the /w switch to launch a new process and always wait for return.
          (Note Even with the /w switch, it still is possible the new process itself started another new sub process where the batch is not aware off)

          sample (I don't know this wbalance.exe program):
          START ""/W "\\berlin\apps\others\wbalance.exe"
          (the extra pair of quotes in this sample sets the title, it is left empty however because most times you never get the chance to see this title in window title bar. But the quotes are actually needed here because otherwise the START command interprets the exe-Path which I also placed between quotes for the title)

          or, if wbalance.exe have to stay in memory longer after the script finished (? dunno this)
          START "" "\\berlin\apps\others\wbalance.exe"
          In this case you cannot Run logon scripts synchronously.
          Alternatively, for those programs that have to stay longer in memory, you can also use the logonscript to just create a shortcut to the program in the "Runonce" key in the HKEY_CURRENT_USER part in the registry.

          For the "printers.vbs" script you start from within your batch do not use START
          but, launch the script like: cscript.exe /NoLogo "\\wilberforce.local\netlogon\printers.vbs"
          So the batch will wait for return.

          OK.. but all the above still does not explain why the drives weren't mapped properly.

          Double check with GROUP POLICY Results the "winning policy" concerning the "always wait for network" policy for the computer.

          The sleep-time you inserted after each mapping is done is not at the right place, it should be after disconnecting and before reconnecting.
          And also try placing the part where the mappings are being done more at the begining of the batch, to test if maybe a prevous command in the batch could be causing problems for the rest of the batch.

          @echo off
          REM # Delete any existing connections for the drives q:, p: and b:
            For %%* in (q, p, b, , ) Do If exist %%*: (
                Set "_Del=TRUE"
                2>nul Net Use %%*: /Del /Yes)
          REM # And if there were drives un-mapped then sleep for about 2/3 seconds
            If /i [%_Del%]==[TRUE] 1>nul ping -n 3
          REM # Wait for Server.   OPTIONAL !!! OPTIONAL !!!
            Set "_Server=PARIS"
            Set /a i=30 
            Set "write=<nul Set/p" 
            %write%=Waiting (max %i% sec) for %_Server%
               >nul (
               Set /a i-=1
               ping -n 1 -w 3000 %_Server%|findstr /ir "\<TTL=[0-9].*\>"
               %write% n=.%n%
               If %i% LSS 1 (echo. UNABLE TO CONNECT! & Goto:EndLoop
               ) Else (goto:BeginLoop)
          REM # Then (re-)connect.
            NET.exe USE q: "\\berlin\apps" /PERSISTENT:NO
            NET.exe USE p: "\\cairo\open" /PERSISTENT:NO
            NET.exe USE b: "\\paris\studenthomesbackup$\%username%" /PERSISTENT:NO
          Last edited by Rems; 16th October 2009, 17:04.

          This posting is provided "AS IS" with no warranties, and confers no rights.


          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts


          • #6
            Re: Mapped drive issue

            Hi Rems

            We are now running the scripts synchronously which has resolved the drive mapping issue?

            I've amended the loginscript so that is not an issue for the .exe's that are called.

            Thanks for your time and effort it has been a great help