General discussion


Force Group Policy to Update Remotely

By keebmachine ·
How can I force all of the computers in the domain to immediately update their group policy settings without forcing the computers to restart?

Note: All of my servers are Windows 2003 and all of my clients are Windows XP SP 2.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by CG IT In reply to Force Group Policy to Upd ...

On the local machine

secedit /refreshpolicy machine_ policy /renforce

secedit /refreshpolicy user_policy

here's a link for changing the defaul group policy refresh interval

Collapse -

by keebmachine In reply to

I should have stated that I would like to update all of the computers from a central location without having to visit each computer.

Collapse -

by dfinch In reply to Force Group Policy to Upd ...

On a workstation, use: gpupdate.exe /force

For many machines, insert this command into the logon batch file located in the Netlogon share on a domain controller.

Other command options are available.

Collapse -

by keebmachine In reply to

I need this to be done without restarting, logging off or anything like that. Thanks for the help.

Collapse -

by keebmachine In reply to Force Group Policy to Upd ...

This question was closed by the author

Collapse -

by keebmachine In reply to Force Group Policy to Upd ...

Here is the solution and it is absolutely AWESOME!!!

copy the text below into a text editor and save it as remotecommand.vbs

This can be used to execute any command on any windows computer that you have admin rights to.

Syntax: cscript.exe remotecommand.vbs COMPUTER1 "gpupdate.exe /force"

Use the following syntax

' Executes a command on a remote system using WMI Scripting
' syntax remotecommand.vbs Computer1 "GPUPDATE /force > C:\logs\VH-ad-01.txt

strComputer = WScript.Arguments.Item(0)
strCommand = WScript.Arguments.Item(1)

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _

errReturn = objWMIService.Create(strCommand,null,null,intProcessID)
if errReturn = 0 Then
Wscript.Echo strCommand & " was started with a process ID of " _
& intProcessID & "."
Wscript.Echo strCommand & " could not be started due to error " & errReturn & "."
End If

Collapse -

Great post!

by scottie_lipa In reply to

Thank you for making my life a whole lot easier! This vbs allowed me to force some clients to run a windows update check to my SUS server, w/o getting the user involved, w/o me walking to each box or waiting until the next day.

Related Discussions

Related Forums