How do i write vbs script for command gpupdate /force

Dear All

 
              I would like to create a vbs script to put in start up for all the client pc, in the vbs script i would like to run following command, i do not want to go each of the computer to type this, as i have over 40 pc need to run this command, i,m deploying a software in GPO, Thx


gpupdate /force
piaakitAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlexProfiletCommented:
The desktops should be running gpupdate on their own when they boot up and login so it should be unnecessary.

I'm not familiar with VBS scripting but I would assume the process is very similar to using batch. You can create the script then put it in a GPO to be executed on login. you con follow this guide: http://www.petri.co.il/setting-up-logon-script-through-gpo-windows-server-2008.htm
0
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
This script could cause you lots of issues as on some PCs, it will ask for a reboot and you could potentially run into an infinite loop.
0
AlexProfiletCommented:
mnkhawaja Is right, depending on your GPO settings it may require a reboot or logoff to take effect.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

piaakitAuthor Commented:
as i know i can skip this command gpupdate /force, an a reboot will help to make the GPO to take effect, am i correct ?
0
piaakitAuthor Commented:
also i would like to know, after i have applied a new GPO in server, how long does it take for the GPO to sync to all the client pc (the GPO is apply to computer account, instead of user account)  ? or any command i can type to take effective immediately ?  coz i have tried to apply a new GPO , and for the client computer, i did not type the gpupdate /force, and i reboot the client computer instead, and i found that the GPO didnt take effect on the client pc i have reboot, then i type gpupdate /force and reboot the client pc, it works, any idea ?
0
AlexProfiletCommented:
Gpupdate runs periodically on all domain members. I don't remember the interval but I believe it's between 15-120 minutes. Rebooting or manually running gpupdate /force cause it to do it immediately.
0
AlexProfiletCommented:
GPOs can be odd sometimes and don't always apply or work right away. Some GPOs require logging off or rebooting. I have seen them not apply on reboot and need to be forced like you saw. Some machines have issues with GPOs applying and require troubleshooting. Although GPOs can be hit or miss sometimes in my experience they usually work on their own after a couple hours and a restart but they can be a bit unpredictable at times which can be frustrating when implementing and testing them.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
piaakitAuthor Commented:
understand it, and thanks !
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.