Created
March 14, 2019 16:18
-
-
Save gmassawe/746da66b10e163c95b6660afcafbd7e3 to your computer and use it in GitHub Desktop.
Script to clear cached GPOs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: | |
:: This script clears cached GPOs | |
:: George Massawe 03/14/2019 | |
:: | |
DEL /S /F /Q “%ALLUSERSPROFILE%\Microsoft\Group Policy\History\*.*” | |
REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy /f | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 7 does not work unless you put "" in
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy" /f