Computer logon hangs or cannot logon when deploying vbscript (.vbs) in a group policy

When deploying the vbscript (.vbs) script at logon using a Group Policy the Windows logon can hang up to 20 Minutes or the default timeout. This occurs due to the GPO being set to synchronous.

Below is the information from Microsoft on how the settings work and why the logon will hang.

"Synchronous processes can be described as a series of processes where one process must finish running before the next one begins. Asynchronous processes, on the other hand, can run on different threads simultaneously because their outcome is independent of other processes. You can change the default processing behavior by using a policy setting for each GPO so that processing is asynchronous instead of synchronous. However, this is not recommended because it can cause unpredictable or undesirable side effects. For example, if the policy has been set to remove the Run command from the Start menu, it is possible under asynchronous processing that a user could logon prior to this policy taking effect, so the user would initially have access to this functionality. To provide the most reliable operation, it is recommended that you leave the processing as synchronous."

Create a batch file (.bat) to run the .vbs script. The GPO will then call the .bat and the .bat file will call the .vbs script and close. This will allow the logon to continue as the batch file completed.

Creating a Batch File

In the same share/ sysvol folder that the .vbs script is located in create new .txt file and add the following:

start /d "\\computername\sharefolder\" user_notification.vbs

Change the \\computername\sharefolder\ to be the same as the location of the share/location of the .vbs script.

Change the user_notification.vbs to be the name or your .vbs script.

Save this as a .bat file. When using notepad you need to change the "Save as type" to All Files and the File name to be the name.bat as shown below.