locked
Can't Map Network Drive with Login Script RRS feed

  • Question

  • We have a logon script that's super basic:

    net use f: /delete

    net use f: \\our\path

    exit

    This script fails with Win8, though; my F: drive never shows up when I login.

    Running the script manually, I get this:

    '\\ourdomain\NETLOGON'

    CMD.EXE was started with the above path as the current directory.

    UNC paths are not supported. Defaulting to Windows directory.

    f: was deleted successfully.

    The command completed successfully.

    Despite the error, manually running the script does result in the F drive being mapped.

    Anyone else seeing this?

    Thursday, March 1, 2012 5:16 PM

All replies

  • Does it not work? I thought that despite that message the scipt worked when i once encountered that message. It was a few yeras ago with a logon script on windows 7.
    It complained cause cmd used the unc path as current directory. Just changed to a local path and was running trough. At least thats what I remember, could be wrong since it's a while ago.

    I'm not using logon scripts for drive mapping anymore I'm using GPOs settings --> Windows Settings --> drive mapping

    Still works with windows 8

    Thursday, March 1, 2012 7:33 PM
  • Do you really need the "exit" command at the end?  It should close automatically anyhow without the need for Exit (in my experiences).
    Thursday, March 1, 2012 8:38 PM
  •  DeathEye is correct in that the error you receive manually is because you are running the script directly from your domain's sysvol path.  A Commad console cannot use a UNC path as the default drive.  So, this error is likely not the cause of the script not mapping.

    - How are you confirming the drive is not mapped?  Are you using Windows Explorer or are you using a command prompt?

    - As a test when the drive does not map during logon, can you open an elevated command window and type NET USE, to see if the command prompt recognizes the mapped drive.

    - Alternatively, you can redirect the output of each item in the script to a text file local to the client (a file path where the current user can write).  You do this by simply following each command in the logon script with >> c:\local_path\output.txt.

    When the user logs on, this should create an output file named output.txt on the client computer that records the information that normally is displayed to the screen after the command completes.  The text file should capture any errors rerturned by the NET command and give you some ideas where to look.  If the file is not created, then its likely that the script is not running.

    Lastly, as DeadEye also mentioned-- you may want to consider using Group Policy Preferneces Drive Mappings as an alternative to a logon script.


    ­Mike Stephens [MSFT] | Support Escalation Engineer | Windows Distributed Systems | Charlotte, NC USA

    • Proposed as answer by MikeStephensMSFT Friday, March 2, 2012 3:19 PM
    • Unproposed as answer by ParrotHead Friday, March 2, 2012 3:25 PM
    Friday, March 2, 2012 5:52 AM
  • I'm using Explorer to view my mappings. I just tried Net Use from an elevated command prompt, and it says there are no entries.

    As an alternative, I tried the Group Policy method. It works as expected on a Win7 test machine (so I know I created it correctly), but my Win8 machine doesn't pick up the mapping.

    I'm stumped.


    • Edited by ParrotHead Friday, March 2, 2012 3:25 PM Correct typo
    Friday, March 2, 2012 3:24 PM
  • was that by using GPO preferences as suggested?

    how is the login script being invoked at present?

    Is it attached to the user properties pages in AD or are you using GPO policies, and logon scripts in there?

    TBH, I would bin the script, and go for the GPO preferences myself (assuming this works for you ultimately here) for efficiency and, well, to bring it out of the 20th century as the script is so basic as you say, it doesn't warrant the resources of kicking up the whole command prompt just to map a drive.

    Wednesday, March 7, 2012 11:28 PM
  • Yes, that's using the GPO preferences instead of the script. I went ahead and migrated everyone over to GPO and ditched the script based on the recommendations here.

    The GPO method works fine for all users and all machines, except for my Win8 VM.

    Friday, March 9, 2012 5:28 PM
  • I have the exact same issue as ParrotHead. I can even see the GPO being applied with gpresult /R. I have no issues on my win7 machines.
    Wednesday, March 28, 2012 8:18 PM
  • Well, I feel a little better that it's not just me.

    I can confirm that this isn't limited to VMs; I now have a physical machine running Win8, and my Group Policy drive mappings don't work with it, either. I see that another user has posted something similar here:

    http://social.technet.microsoft.com/Forums/en-US/w8itprogeneral/thread/421c2785-d6f4-4f77-b486-9f4e73d5886c

    Thursday, March 29, 2012 1:26 PM
  • I also did a native install on a spare box, thinking it might be the VM. Same thing. There is one thing to note, we map users personal drive through account profile settings (Profile -> Home Folder) , that does map. Also I do get a drive mappping to my web server, but nothing on the main file server. The only difference I can think of is, our main file server is also a domain controller.
    Thursday, March 29, 2012 3:20 PM
  • Same here. I have since pulled down the script to my desktop and run it from there every time I have to log off and back on. I thought I might try installing Windows Server 8, and see if that fixes the problem, but I haven't gotten around to it.
    Wednesday, April 25, 2012 1:55 AM
  • I have the same problem. I did a fresh new install of Windows 8. I was able to attach it to a windows 2008 R2 server but I am unable to see the network mappings. There has to be a patch for this.
    Friday, May 11, 2012 8:11 PM
  • I've also noticed this same problem on 2 Win8 Release Preview machines I just loaded yesterday and today.  I have been using GPO to map the drive for a couple of years and that works fine on the Win7 machines, but Win8 isn't doing it.  But it gets worse than that.  I manually mapped the drive via the GUI in Computer and made sure to check the box "Reconnect at sign-in", but after a reboot it lost the mapped drive.
    Monday, June 4, 2012 5:29 AM
  • I've experienced the same results in my test lab with both VM's and physical installs of Windows 8 Release Preview.  I think the GPO is actually removing the manual mappings when it attempts to apply.  RSOP says everything is applied as normal but no mappings are there.  Everything is fine on Windows 7 for the same policy.  I too am going to try installing Server 2012 RC tomorrow and see what the new RSOP features have to say about things...
    Monday, June 4, 2012 12:46 PM
  • Has anyone tried this registry entry(EnableLinkedConnections)?  Don't know if it applies for Windows 8 but I've seen this work in some odd cases with Windows 7.  It isn't recommended for security reasons but it may aid in finding the cause.

    http://support.microsoft.com/kb/937624


    • Edited by dgobe Tuesday, June 5, 2012 3:54 AM
    • Proposed as answer by [U].[M].[M] Tuesday, April 30, 2013 2:04 AM
    Tuesday, June 5, 2012 3:46 AM
  • Running Windows 8 as my main OS I am having the same issue with my drive not being mapped using group policy (2008R2 Domain). This is on my home network. GPRESULT /H shows that the policy applied successfully as well, running a net use shows no mapped drives.
    Monday, June 18, 2012 9:44 AM
  • I'm also not getting my mapped drives that should be applied from group policy preferences.  gpresult /r shows the policy applied.  I turned on GPP tracing and from what I can tell, the log says everything worked.  Still, I have no mapped drives.  Running "net use" at both a command prompt and an administrative command prompt both show "there are no entries in the list."  I am able to manually map the drives with a net use command. 

    Running Win8 Release Preview in a 2008R2 domain.

    Wednesday, August 1, 2012 2:21 PM
  • This is still seems to be an issue with the RTM release from everything I have gathered.
    • Edited by MichaelGos Tuesday, August 7, 2012 9:06 PM
    Tuesday, August 7, 2012 8:58 PM
  • same here, work with win8 and get the same error, but everything is fine with Win7 and other client machine....
    Wednesday, August 15, 2012 9:15 AM
  • +1

    Same issue here as well :(

    Saturday, August 18, 2012 9:53 AM
  • Drives map fine if you login as a user, they don't map if you login as a network admin.
    It's intended for UAC to behave this way.  How unfortunate.

    My domain mapped drives from my SBS2011 server in the lab will not map to a Windows 8 computer if I login as an admin, logging in as a test "user" account, they all map as intended.


    Saturday, August 18, 2012 4:19 PM
  • Drives map fine if you login as a user, they don't map if you login as a network admin.
    It's intended for UAC to behave this way.  How unfortunate.

    My domain mapped drives from my SBS2011 server in the lab will not map to a Windows 8 computer if I login as an admin, logging in as a test "user" account, they all map as intended.



    Matthew - you flagged this as a potential answer, but it isn't an answer.  It is a confirmation of the original (and subsequent) post's symptoms with additional troubleshooting.  The 'answer' is for MS to fix their code and make it work properly.  Until that happens, this problem isn't answered.
    Sunday, August 19, 2012 1:54 AM
  • I can't say where I read it, but I do remember looking into this problem previously with windows 7 and mapping drives in logon scripts.  As I recall, the answer was that it was working as intended, and an admin would not be able to get mapped drives from logon scripts.  However, right along with that came a recommendation to use Group Policy Preferences instead.  That was the 'new' recommended way to map drives, and would not be affected by the issue.  

    That worked for me under win7, but win8 broke GPP drive mappings for admins as well.  

    Sunday, August 19, 2012 2:24 AM
  • I'm having the same problem.  I didn't bother with it during the preview or earlier versions since I figured it would be resolved in RTM, but alas it's not.

    I think my setup is identical to the original poster:  Windows Server 2008 R2 DCs, first Windows 8 client.  Simple scripts run fine everywhere else and have for years (set as User logon scripts)... but they're not running on Windows 8.  I'll try some of the logging suggestions in this thread to see what they tell me.

    MD \\theserver\users$\%USERNAME%
    NET USE W: /DELETE /YES
    NET USE W: \\theserver\users$\%USERNAME%
    NET USE X: /DELETE /YES
    NET USE X: \\theserver\files$
    NET USE Y: /DELETE /YES
    NET USE Y: \\theserver\media$

    Sunday, August 19, 2012 3:10 PM
  • Hy Guys!

    Same issue here.
    My GPO for mapping Network drives work fine with Win7 and other Clients but make Problems with Windows 8.

    Monday, August 20, 2012 5:31 AM
  • Exactly the same problem here - made worse because the Developers and Tech Support Teams need local admin rights (for obvious reasons!) so it will effect the entire of both teams when the time comes...
    Monday, August 20, 2012 10:27 AM
  • Ok.

    It seems to work in partial :-S

    I have my policies in Replace mode so it means that if I create my mappings manually, next time refresh kicks in my mappings are then lost again... :-(
    Really strange behavior...

    Monday, August 20, 2012 12:30 PM
  • Ok

    After many hours of investigation I think I have a "workaround" that you may use until they fix the real issue.

    http://gjohansson.com/blog/2012/08/22/windows-8-gpp-drive-maps-fails/

    • Proposed as answer by GJohansson Wednesday, August 22, 2012 12:11 PM
    Wednesday, August 22, 2012 12:11 PM
  • Thanks GJohansson - thats got it sorted for me here too!

    Lets hope MS come out with a fix eventually, but for now thats us up and running

    Wednesday, August 22, 2012 12:45 PM
  • Ah GJ, you must've read it from here..

    http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/64e01325-9b2f-477c-ab51-7b10692b583a/

    Well done if you worked it out on your own though. ;)


    Wednesday, August 22, 2012 11:23 PM
  • Ah GJ, you must've read it from here..

    http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/64e01325-9b2f-477c-ab51-7b10692b583a/

    Well done if you worked it out on your own though. ;)


    Nope. But if I had I wouldn't spent 6 hours on investigation...
    But on the other hand I was surprised to be first with the "solution" which in the end I was not...

    Anyhow I want reconnect so let's hope MS delivers a patch soon.


    -- G Johansson http://gjohansson.com/blog/

    Thursday, August 23, 2012 7:41 AM
  • I had the same problem with mapped drives not displaying via when using a GPO on the Windows 8 Desktops. GPOResult showed the GPO had been applied with no errors. Strange thing was when i ran a netuse via cmd the network drives were all there! I added the key below to the registry and now the drives are displayed after a reboot HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System EnableLinkedConnections =(dword)1 Hope this helps
    • Proposed as answer by DanielLeung Saturday, August 25, 2012 5:42 AM
    • Unproposed as answer by DanielLeung Saturday, August 25, 2012 5:43 AM
    • Proposed as answer by Dave_Chapman Sunday, November 11, 2012 7:25 PM
    Friday, August 24, 2012 1:45 PM
  • I just got the Windows 8 Enterprise RTM on Technet today.

    On Windows 2003 Server - using map.bat - production server

    GPO Editor -> User Configuration -> Windows Settings -> Scripts -> Logon

    The script no longer work with Windows 8 - No drives can map

    + domain users always logon using temporary profile

    + cannot access install anything from Microsoft Market

    On Windows 2008 R2 - using GPO - drive mapping - Test Server not production server

    Regular Domain Users, Drives map fine

    Domain Admins, Drives WILL NOT map

    Now, making me crazy. I have 300 users on Windows 2003 Server and around 200 PCs mixed with Windows XP pro and Windows 7 Pro. So, Microsoft is trying to tell me to stay with Windows 7 forever if you don't do anything on your Windows 2003 server + .bat mapping scripts


    • Edited by DanielLeung Saturday, August 25, 2012 5:55 AM
    Saturday, August 25, 2012 5:53 AM
  • Could the following issue be related?  Does anyone have a solution for it?

    I've used Win7 Pro for years with my Documents folder on a mapped network drive without issue.  I upgraded to Win8 Pro and suddenly I get the infamous "Error 1327. Invalid Drive" error.  I know if my Documents folder (in registry User Shell Folders) was changed to C:\ (local) it would be fine, but that's not what I'm trying to accomplish.

    Any Ideas?

    Thursday, September 6, 2012 12:00 AM
  • Could the following issue be related?  Does anyone have a solution for it?

    I've used Win7 Pro for years with my Documents folder on a mapped network drive without issue.  I upgraded to Win8 Pro and suddenly I get the infamous "Error 1327. Invalid Drive" error.  I know if my Documents folder (in registry User Shell Folders) was changed to C:\ (local) it would be fine, but that's not what I'm trying to accomplish.

    Any Ideas?


    If you have the Documents folder directed to a mapped network drive letter (ie, N:\Documents or something like that), and you are impacted by the Win8 not mapping network drives problem, then it could be related.  Change your Documents folder mapping (in the User Shell Folders or via GPO Folder Redirection) to a UNC path instead of drive letter (ie. \\servername\sharename\Documents).  That should work.  I am using a Folder Redirection GPO in my environment and didn't see the problem you described when my drives didn't map.
    • Proposed as answer by Ashkaan4 Thursday, September 6, 2012 4:18 AM
    • Unproposed as answer by Ashkaan4 Friday, September 7, 2012 4:41 AM
    Thursday, September 6, 2012 12:50 AM
  • If you have the Documents folder directed to a mapped network drive letter (ie, N:\Documents or something like that), and you are impacted by the Win8 not mapping network drives problem, then it could be related.  Change your Documents folder mapping (in the User Shell Folders or via GPO Folder Redirection) to a UNC path instead of drive letter (ie. \\servername\sharename\Documents).  That should work.  I am using a Folder Redirection GPO in my environment and didn't see the problem you described when my drives didn't map.

    wlocke, you are correct sir.  That worked!

    I'm sure others will have this issue until M$ fixes this bug and this post will hold the key to resolving their issue.  You will forever be known as the person that has solved this issue.

    Thank you.

    Thursday, September 6, 2012 4:18 AM
  • Please remove that as a proposed answer. You are having a separate issue than everyone else. We are not getting any errors. The network drives simply don't map unless you use the workaround which involves unchecking the "Reconnect" tick in GPP. All event logs say everything maps successfully without errors.
    Thursday, September 6, 2012 4:37 PM
  • Please remove that as a proposed answer. You are having a separate issue than everyone else. We are not getting any errors. The network drives simply don't map unless you use the workaround which involves unchecking the "Reconnect" tick in GPP. All event logs say everything maps successfully without errors.
    I misunderstood how this website works.  I thought I was marking it as AN answer to A problem.
    Friday, September 7, 2012 4:42 AM
  • Please remove this as a proposed answer. This fixes it in LIMITED circumstances. Ours are not mapping at all, not even with net use.

    Wednesday, November 14, 2012 12:23 AM
  • Hi all

    I just wanted to let you know that i have been running a case with Microsoft for the past 20 days and yesterday i finally got the answer i wanted.

    Here is what Microsoft support wrote:

    Unfortunately we have found a BUG and it will be fixed as soon as possible.
    Windows SE 419875 (ETA for fix is 12th February 2012)


    Regards,
    Thomas

    • Proposed as answer by Tjay42 Wednesday, December 19, 2012 7:34 AM
    Wednesday, December 19, 2012 7:33 AM
  • Now it's solved: http://support.microsoft.com/kb/2795944
    More info from me: http://bit.ly/11GPP7h

    -- G Johansson
    http://gjohansson.com/blog
    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    • Proposed as answer by G Johansson Wednesday, February 13, 2013 7:18 PM
    Wednesday, February 13, 2013 7:15 PM
  • Now it's solved: http://support.microsoft.com/kb/2795944
    More info from me: http://bit.ly/11GPP7h

    -- G Johansson
    http://gjohansson.com/blog
    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.


    I have verified this as well.   Drive mapping on windows 8 works fine on all of our Windows 8 PC's with this update.
    Thursday, February 14, 2013 8:12 PM
  • Worked for me also.
    Thursday, February 14, 2013 8:14 PM
  • Has anyone tried this registry entry(EnableLinkedConnections)?  Don't know if it applies for Windows 8 but I've seen this work in some odd cases with Windows 7.  It isn't recommended for security reasons but it may aid in finding the cause.

    http://support.microsoft.com/kb/937624



    Thank dgobe, It Worked For Me..

    • Edited by [U].[M].[M] Tuesday, April 30, 2013 2:30 AM
    Tuesday, April 30, 2013 2:05 AM
  • Has anyone tried this registry entry(EnableLinkedConnections)?  Don't know if it applies for Windows 8 but I've seen this work in some odd cases with Windows 7.  It isn't recommended for security reasons but it may aid in finding the cause.

    http://support.microsoft.com/kb/937624



    Thank dgobe, It Worked For Me..


    No reason to use that registry fix...Microsoft finally fixed it in a Windows Update
    Tuesday, April 30, 2013 5:57 AM