Created
July 1, 2016 18:31
-
-
Save nerflad/771b1c375d2218220bba281cc2f31341 to your computer and use it in GitHub Desktop.
Windows: backup Local Group Policy to directory
This file contains 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
:: Requires Administrator | |
:: Copies entire GP object directory from system32 to current working directory | |
@echo off | |
setlocal EnableExtensions | |
setlocal | |
set "dirname=.\policyobjects - %DATE% %TIME%" | |
takeown /a /f %systemroot%\system32\grouppolicy /r /d y | |
xcopy %systemroot%\system32\grouppolicy "%dirname%" /s /h /i /y | |
attrib -h .\policyobjects /d /s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment