Thursday, November 25, 2010

VB Script to run gpupdate.exe /force silently without a reboot

If you use Gpupdate.exe /force in your logon scripts ypu would've of found by now that sometimes if not most often when running gpupdate.exe you are asked to either logoff or reboot to apply configuration settings. You've also probably found that there is no exact command like 'Gpupdate.exe /Force /Silent.'

The below VBscript below will run Gpupdate.exe /force without any user interaction it will also not show any log off or reboot requests.

To implement this in a logon script place the code below into its own SilentGPupdate.vbs file. Then call it from your logon script, I've set the WshShell.Run not to wait to finish each command because gpupdate.exe can run in its own space and time (doing this will keep your login times quick).

13 comments
:

The script is not working for me. When I run it, it infinitly starts the script over and over, had 1800 processes of it running, and it maxes out the PC until I delete the actual script to get it to stop.

This helps to ensure the proper version of GPUpdate.EXE runs - Best practice indicates when executing an external command from a script that the script leave nothing ambiguous and calls the external command from a known location.