How to Backup and Restore Local Group Policy Settings in Windows 10
The Local Group Policy Editor (gpedit.msc) is a Microsoft Management Console (MMC) snap-in that provides a single user interface through which all the the Computer Configuration and User Configuration settings of Local Group Policy objects can be managed.
The Local Group Policy Editor is only available in the Windows 10 Pro, Enterprise, and Education editions.
By default, local group policy settings are saved in the three hidden folders below. This is what the downloadable .vbs files below will automatically backup and restore for you.
(Computer Configuration)
%SystemRoot%\System32\GroupPolicy\Machine
(User Configuration)
%SystemRoot%\System32\GroupPolicy\User
(User/Group Specific GPOs Configuration)
%SystemRoot%\System32\GroupPolicyUsers
This tutorial will show you how to backup and restore Local Group Policy settings on any Windows 10 Pro, Enterprise, or Education PC.
You must be signed in as an administrator to back up and restore Local Group Policy Editor settings.
This will not include Local Security Policy settings.
Contents
- Option One: To Backup Local Group Policy Editor Objects from a PC
- Option Two: To Restore Local Group Policy Editor Objects to a PC
EXAMPLE: Local Group Policy Editor
1 Click/tap on the Download button below to download the .vbs file below.
Backup_Local_Group_Policy.vbs
Download
Contents of .vbs file for reference.
Code:If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1 Else Set oShell = WScript.CreateObject ("WScript.Shell") oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y %SystemRoot%\System32\GroupPolicy\Machine %userprofile%\Desktop\Local-Group-Policy-Backup\Machine"),0 oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y %SystemRoot%\System32\GroupPolicy\User %userprofile%\Desktop\Local-Group-Policy-Backup\User"),0 oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y %SystemRoot%\System32\GroupPolicyUsers %userprofile%\Desktop\Local-Group-Policy-Backup\GroupPolicyUsers"),0 End If
2 Save the .vbs file to your desktop.
3 Unblock the .vbs file, and run the .vbs file.
4 Click/tap on Yes when prompted by UAC.
5 You will now have a Local-Group-Policy-Backup folder on your desktop that is the backup of the local group policies on this PC.
6 Move this folder to where you like for safe keeping.
Do not rename this folder since it must remain the exact same name to be able to use it in OPTION TWO below to restore.
1 Move or copy the Local-Group-Policy-Backup folder created from OPTION ONE above to your desktop.
2 Click/tap on the Download button below to download the .vbs file below.
Restore_Local_Group_Policy.vbs
Download
Contents of .vbs file for reference.
Code:If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1 Else Set oShell = WScript.CreateObject ("WScript.Shell") oShell.run ("cmd.exe /c RD /S /Q %SystemRoot%\System32\GroupPolicy\Machine"),0 oShell.run ("cmd.exe /c RD /S /Q %SystemRoot%\System32\GroupPolicy\User"),0 oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y %userprofile%\Desktop\Local-Group-Policy-Backup\Machine %SystemRoot%\System32\GroupPolicy\Machine"),0 oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y %userprofile%\Desktop\Local-Group-Policy-Backup\User %SystemRoot%\System32\GroupPolicy\User"),0 oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y %userprofile%\Desktop\Local-Group-Policy-Backup\GroupPolicyUsers %SystemRoot%\System32\GroupPolicyUsers"),0 WScript.Sleep 2000 oShell.run "cmd.exe /k gpupdate /force" End If
3 Save the .vbs file to your desktop.
4 Unblock the .vbs file, and run the .vbs file.
5 Click/tap on Yes when prompted by UAC.
6 When both Computer policy and User policy update has completed successfully, you can close the command prompt. (see screenshot below)
That's it,
Shawn Brink
Related Tutorials
- How to Open the Local Group Policy Editor in Windows 10
- How to Manually Update Group Policy Settings in Windows 10
- How to See Applied Group Policies in Windows 10
- How to Apply Local Group Policies to Specific User in Windows 10
- How to Apply Local Group Policy to Non-Administrators in Windows 10
- How to Apply Local Group Policy to Administrators in Windows 10
- How to Reset All Local Group Policy Editor Settings to Default in Windows 10
- How to Add Local Group Policy Editor to Control Panel in Windows