When deploying the vbscript (.vbs) script at logon using 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."
There are two ways to resolve the issue:
- Change the group policy to be Asynchronous. Please see the following link on the GPO setting. http://msdn.microsoft.com/en-us/library/ms812997.aspx
- 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.
You should now have a .bat file listed in your SYSVOL/Share folder.
More information on creating batch files can be found here:
Pointing the GPO to use the Batch File
You will need to change the Group Policy to point to the .bat file instead of the .vbs script. Please see the following links for help with the location of the Group Policy.Follow