Export/Import Group Policies and Services Windows 10
Group Policy
Reports note this still works in Windows 10.
Solution from here: http://www.frickelsoft.net/blog/?p=31
On the source machine, open the hidden folder %systemroot%\system32\grouppolicy\
and copy the Machine
and User
directories.
On the target machine, open the same hidden folder and paste the two directories, overwriting existing files and folders.
Run gpupdate /force
and restart your computer.
Services
The Service State (stopped/started) can be easily read and set using Powershell.
The thing is, many default Windows services cannot be modified, so instead of trying to record all of the existing Services and their start-up types and statuses on one computer and then recreating that on another, you should instead compile a list ONLY of the services you wish to modify from their default state.
Once you have such a list, use the Powershell cmdlet Set-Service
to set their desired state. Create a .ps1 file with a line like follows for each of the services you with to change from default:
Set-Service -Name ServiceName -StartupType Automatic/AutomaticDelayedStart/Manual/Disabled
Run this script on the new computers and all the services' states will be set as specified.
Registry
Like services, you only want to modify the specific keys that deviate from default that are ABSOLUTELY REQUIRED TO BE CHANGED.
So, like the services, you need to carefully study and record those keys that need to be modified, compile a reg file of the desired changes, and run this reg file on each new computer.
Do NOT under any circumstances export the entire registry and import it. This is too likely to cause serious problems.
Bringing it all together
You can do all of this with Powershell in a single script:
- The Group Policy stuff is just copying files from your backup location onto the new computer.
- The Service stuff is just running a script configuring the StartupType argument.
- The Registry stuff is importing a .reg file.
Related videos on Youtube
Ptheguy
Updated on September 18, 2022Comments
-
Ptheguy over 1 year
I have configured
Registries
,Services
, andGroup Policies
on Windows 10 to tailor my windows experience. I also tend to experiment with my OSes a lot and often I end up re-installing Windows and having to go through setting up all the aforementioned settings.I am looking for a way to export the above settings (all three of them) in such a way that I can then import them in one click on a fresh Windows installation to avoid having to set up everything from scratch. I was able to export
Registries
easily and I know I can import that just fine. However, when I exportServices
andGroup Policies
, it outputs a.txt
file and there doesn't seem to be a way to import them. Any ideas?-
Ramhound over 5 yearsThis might be useful Import a GPO from a File. It isn't clear if you are talking about an Active Directory domain or just local machine's group policies.
-
Ptheguy over 5 yearslocal machine's group policies. Sorry!
-
-
Ptheguy over 5 yearsAnd for services? Anything possible there?