Reset Group Policy Cache


Here is a custom action that will delete a local workstation’s Group Policy cache. This is useful when a machine gets out of synch with the Domain Controllers and has GPO errors in the event logs. This will work on Windows XP and Windows 7 and it does require psexec.exe.

Custom Action

Quote:

{actionpath}psexec.exe \\{computer} -u administrator -p YOURLOCALADMINPASSWORD /c {actionpath}DeleteGPOCache.bat

DeleteGPOCache.bat

Quote:

DEL /S /F /Q “%ALLUSERSPROFILE%\Application Data\Microsoft\Group Policy\History\*.*”
gpupdate /force
Script:
@echo off
DEL /S /F /Q "%ALLUSERSPROFILE%\Application Data\Microsoft\Group Policy\History\*.*"
REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies /f
REG DELETE HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies /f
DEL /F /Q C:\WINDOWS\security\Database\secedit.sdb
Klist purge
gpupdate /force
exit
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: