Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Logon Script won't run if network isn't available

Posted on 2013-11-25
Medium Priority
Last Modified: 2013-12-06
My logon script set through GPO will not run if the network connection isn't available on startup.

For example, if the user logs off and logs back on, the script will run.  If the user waits a long time on initial startup before logging in, the script will run   However, if the user quickly logs in on initial startup before the network is available, the script will not run at all.  (the script is a batch file)

I would rather not run scripts synchronously, because that slows things down particularly for laptop users when they are off the network.  Is there a way to force Windows to cache the script locally to start before the network is up?

The server environment is Windows 2008 R2 and the workstations are Windows 7.
Question by:nnolte99
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1

Expert Comment

ID: 39675531
If I'm understanding your post then the logon script is local to the AD server and not the workstation your user(s) would be logging into.  So if the network is not available the script is not accessible, because its on the server not the workstation.

Author Comment

ID: 39675546
Yes. That way when I update the script I only have to update the script in one location.
LVL 10

Expert Comment

ID: 39675555
Are the systems connecting wirelessly?  I would set the local policy on the systems to 'wait for network before logging on'  when they are connected to domain the script should then run ok.  GPEDIT.MSC  Computer Config - admin templates - system - logon - always wait for network... to enable.
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.


Author Comment

ID: 39675574
The systems are, for the most part, connecting through wire.  

Re your suggestion, what if the user is a laptop user working remotely. Won't that cause the person to hang for a long time.
LVL 56

Accepted Solution

McKnife earned 2000 total points
ID: 39677345
There are ways, yes.
We can by a policy require that the network needs to be initialized before logon: http://technet.microsoft.com/en-us/magazine/gg486839.aspx - that is something else to running scripts synchronously.

You could also use a scheduled task instead of the common logon script. Deploy a task that gets triggered at logon of any user. Set a delay of 10/20 seconds inside that task and you are done.
LVL 10

Expert Comment

ID: 39681631
No it making the computer wait for network connection setting just makes it wait any detected network to get connected and then continue on the logon process as before,
LVL 56

Expert Comment

ID: 39682278
What should that mean? Come again, please.
He wrote: "if the user quickly logs in on initial startup before the network is available, the script will not run at all" - that tells me that waiting is exactly what should be done here and the policy waits for the NIC to signalize it's connected.

Author Closing Comment

ID: 39701915
Scheduled task assigned through AD is the way to go.

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question