Link to home
Start Free TrialLog in
Avatar of Eric Jack
Eric JackFlag for United States of America

asked on

Domain account logon/login script not running on Windows 10

I have a login script configured for users at the domain account level. In ADU&C, go to a user's properties. In the Profile tab, the "logon script" is set to login.vbs (which points to c:\windows\sysvol\domain\script on the domain controller.

This login.vbs doesn't do much more than map a bunch of network drives. Some common, some dependent upon what security groups a user is a member of. This has worked fine for years in WinXP and Win7.

However, I'm now testing Win10 and discovered that the login script does not run upon login. If I manually run the login.vbs, it works fine and maps all the drives as it should. So the question is: Why isn't the logon script running when logging into WIn10? What do I need to do to make it work? So far, my searching has not found an answer.

NOTE: I've come across several posts regarding using Group Policy instead. Maybe that's the better solution today. But I would like a fix for what I already have. I don't have time to research how to change how I do my drive mappings at this very moment.
Avatar of McKnife
McKnife
Flag of Germany image

Win8.x and 10 delay logon scripts for exactly 5 minutes by default. Can be configured by gpo. Logon script delay.
Avatar of Eric Jack

ASKER

Hmm, okay. Now I'm confused...

I could have sworn the first few times I booted up, I didn't see network drives even after 5-10 minutes. So I was going to start fresh, log in, and time it. I booted up, logged in, and lo and behold, the network drives were there immediately! No 5 minute delay.

I didn't change a thing! So why all of a sudden did this 5 minute delay go away after I posted this thread!? Did me manually running the login.vbs tell Windows somehow it was okay to run right upon login?
If you script a connection once, the connection will persist. That's default behavior.
Okay, looking for clarification...

When I manually ran the login.vbs, the network drives were mapped. Then I rebooted and logged in and the network drives were immediately mapped again. No 5 minute delay.

When I took the laptop home and booted up, no network drives because I'm off the domain.

When I went back to the office and booted up, the network drives were available immediately again. No 5 minute delay.

So, if the drive mappings were persistent, such as when you manually map a drive and tell it to reconnect on on next logon, why didn't I have network drives with red Xs on them when at home?
ASKER CERTIFIED SOLUTION
Avatar of McKnife
McKnife
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The problem is I'm not understanding the process of how/when the script runs. Doesn't the script run each time I log in while connected to the domain? If so, then why am I getting network drives immediately after logging in now. But when I first installed Windows 10, I had to manually run the login.vbs to get my network drives. As of yet, I have not adjusted the logon script delay in the local group policy, so it should still be using the default 5 minute delay.

When i take the laptop home, I don't have any network drives, which is to be expected. I'm not on the domain, so there is no script to run.
If have seen weird thing concerning drive mappings myself, so I stopped asking "why" because there are bugs around which don't deserve a "why".
MS recommends to use this, you should do it and no problems are to be expected: https://blogs.technet.microsoft.com/askds/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership/
At the moment I can't do any further testing. My test install of Win10 crashed and I reverted back to a Win7 image.

I still don't quite understand why the script started running immediately after each reboot after I manually ran it once. Even after being off the company network. But I think the links provided give a basic understanding of the problem.

If and when I convert to using GPO to map drives instead, I'm not quite sure what will happen for people to connect to the network after logging in, such as after joining a wi-fi network or logging into VPN. But I'll cross that bridge when I get to it.
Eric you aren't crazy and it isn't a 5 minute delay. I to have several drive mapping login scripts. I use bat files. So far two of may customer have reported the same thing after moving to Windows 10. Even after 30 minutes there are no mapped drives.

It you run the script manually they show up at which point persistence comes in to play but regardless the scripts aren't working. I'll put a pause in and let you know if they are even being ran...
I've been deploying Win10 systems for about a month now, and I also switched to using Group Policy to map drives. That seems to be working okay.

The only "gotcha" was the GPO mapped drives are persistent on Win7 machines, but kept disappearing on Win10 machines. I went back to the Group Policy settings and checked the box for "Reconnect" which seems to have solved that problem. (Don't know why it was leaving them mapped, even when off the domain on a Win7 box without that checked... but whatever.)

The other issue I've noticed is Win7 machines take much longer to boot/log-in if they are off the domain and can't find those network drives.
Well... GPO mapping would probably work but I am going to try and figure out why scripts don't run. It is that the scripts don't run. I have a 2012 Server and when I put a pause in the base file and log in I can see that the script runs and works. No 5 minute delay. It is instantaneous.

I put the same pause in at a customer's site and it isn't even running the script. They have a 2012 server also. So something is going on but it doesn't seem to be consistent. I have yet another customer that has a 2008 server and it isn't running on their's either.
I think I will open a new question since this one is closed.....
That didn't take as long as I thought. This Windows 10 computer had absolutely no access to the netlogon folder when it first logs on. After it got to the desktop I tried running the script directly from the command prompt with a \\server\netlogon\my.bat and it came back with "access denied".  I tried mapping a drive letter to the netlogon folder and it  immediately popped up asking for credentials. I used the exact same credentials as the user that is logged on. It mapped at which point I could run the bat file.