CODEDIGEST
Home » Articles
Search
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
How to refresh the Group Policy Settings on remote computers

By Nirmal Sharma
Posted On Mar 29,2008
Article Rating:
Be first to rate
this article.
No of Comments: 10
Category: Directive Service
Print this article.

How to refresh the Group Policy Settings on remote computers

The Group Policy Settings are refreshed as per the interval configured in the Group Policy for client computers, member servers and domain controllers. You can use the following command line tools to refresh the Group Policy Settings on remote computer. You need to log on to the computer manually and then perform the action suggested below:

 

For Windows XP computers:

·          Gpupdate.exe /Target:User /force

·          Gpupdate.exe /Target:Computer /force

 

For Windows 2000 computers:

·          Secedit.exe /refreshpolicy user_policy

·          Secedit.exe /refreshpolicy machine_policy

 

To refresh the policy on remote computer or computers you can use the following script to do so:

1.      Create a ComputerList.txt

2.      Put all the remote computers in the Text file.

3.      Use the Psexec.exe tool to execute the command remotely.

 

For Windows XP Computers:

Psexec.exe -@ComputerList.txt Gpupdate.exe /Target:User /force

Psexec.exe -@ComputerList.txt Gpupdate.exe /Target:Computer /force

 



For Windows 2000 Computers:

Psexec.exe -@ComputerList.txt secedit.exe /refreshpolicy user_policy

Psexec.exe -@ComputerList.txt secedit.exe /refreshpolicy machine_policy

 

The above Psexec.exe command will run on all the computers specified in the ComputerList.txt.

 

You can also use the following script to check the version of Operating System and then issue the command:

@echo off

XPGPORef1=gpupdate.exe /Target:User /force

XPGPORef2=gpupdate.exe /Target:Computer /force

Win2kGPORef1=secedit.exe /refreshpolicy user_policy

Win2kGPORef2=secedit.exe /refreshpolicy machine_policy

For /f “Tokens=*” %%a in (ComputerList.txt) Do (

SET Comp_name=%%a

Ver.exe \\%comp_name% > Hostver.txt

Find /I “XP” < Hostver.txt > CheckCC.txt

IF %errorlevel% == 0 (

Psexec.exe \\%comp_name% Gpupdate.exe /Target:User /force

Psexec.exe \\%comp_name% Gpupdate.exe /Target:Computer /force

) ELSE (

Psexec.exe \\%comp_name% secedit.exe /refreshpolicy user_policy

Psexec.exe \\%comp_name% secedit.exe /refreshpolicy machine_policy

)

)

The above script will check the Operating System version by executing Ver.exe on remote computer and then run the appropriate commands to refresh the Group Policy Objects.

Similar Articles

You can contribute to CodeDiget.Com:
Donate to CodeDigest.com
Article Feedback
Comments
Ah yes, nicely put,
Ah yes, nicely put, evyeeonr. http://ndmtdzoarsu.com [url=http://iwkvvayptbz.com]iwkvvayptbz[/url] [link=http://fndlvqsm.com]fndlvqsm[/link]
Ah yes, nicely put,
Ah yes, nicely put, evyeeonr. http://ndmtdzoarsu.com [url=http://iwkvvayptbz.com]iwkvvayptbz[/url] [link=http://fndlvqsm.com]fndlvqsm[/link]
Ah yes, nicely put,
Ah yes, nicely put, evyeeonr. http://ndmtdzoarsu.com [url=http://iwkvvayptbz.com]iwkvvayptbz[/url] [link=http://fndlvqsm.com]fndlvqsm[/link]
That's not just the
That's not just the best anrsew. It's the bestest answer! http://aopjxevmm.com [url=http://zvwcdi.com]zvwcdi[/url] [link=http://xvidbjrahci.com]xvidbjrahci[/link]
That's not just the
That's not just the best anrsew. It's the bestest answer! http://aopjxevmm.com [url=http://zvwcdi.com]zvwcdi[/url] [link=http://xvidbjrahci.com]xvidbjrahci[/link]
That's not just the
That's not just the best anrsew. It's the bestest answer! http://aopjxevmm.com [url=http://zvwcdi.com]zvwcdi[/url] [link=http://xvidbjrahci.com]xvidbjrahci[/link]
Heck yeah bae-ybe ke
Heck yeah bae-ybe keep them coming!
Heck yeah bae-ybe ke
Heck yeah bae-ybe keep them coming!
Heck yeah bae-ybe ke
Heck yeah bae-ybe keep them coming!
Not working
I tested ver.exe //computerName from xp sp2 and server 2003 sp2 and is not working. It just displays the windows version of the current computer, not the remote one.

Also psexec \\computerName ver.exe gives an error