Admin Power Level: Intermediate Chapter 14: Set Rules Once, Apply Them Everywhere

Back up, restore, and refresh a GPO

Back up a GPO before you change it. Restore brings it back. Refresh applies policy now, instead of waiting for the normal refresh interval.

Lesson 2 of 2 in Chapter 14: Set Rules Once, Apply Them Everywhere. Previous step in this path: Get a GPO and read its reports. 3 learning objectives, 10 examples, and a knowledge check.

Start: what you will learn

Back up a GPO before you change it. Restore brings it back. Refresh applies policy now, instead of waiting for the normal refresh interval.

Learning objectives

  • Back up a GPO to a folder
  • Restore a GPO from a backup
  • Refresh policy on demand with gpupdate

Concept in simple words

Warning first, before any change: only work on a GPO in your own domain and lab, and only with permission to change it. A GPO change is not a private experiment. One linked GPO can change the sign in experience for many users at once. Back up the GPO before you change it, test the change on a small group first, and never apply an untested policy domain wide. If you are not sure you have permission, stop and ask. A backup does not make an unauthorised change safe, it only makes an authorised change reversible.

What it is, from zero: backing up a GPO means copying its settings to a folder before you change it. Restoring brings that saved copy back into the GPO. Refreshing policy does not change the GPO at all. It only tells a computer to fetch and apply the current policy right now, instead of waiting for the next automatic refresh. Backup and restore protect the definition of the policy. Refresh controls when a computer picks that definition up. Mixing those two jobs up is how people refresh again and again while the real problem sits in the GPO itself.

What a backup actually contains, and what it does not: a backup saves the GPO settings and the identity of the GPO, so you can return to that saved version later. Each backup gets its own backup id, which is different from the GPO id. The GPO id identifies the GPO itself, while the backup id identifies one saved version of that GPO at one point in time. A backup on its own does not recreate everything around the GPO, so record the links, the link order, the inheritance setting, and the filtering separately, and check them again after a restore. A backup also cannot rebuild a domain or a domain controller. It is a saved version of one policy, not a full system recovery plan.

Why it works

Why the backup folder matters so much: the backup folder must already exist before you run Backup-Gpo, and every backup you make in that folder gets its own subfolder named by its backup id. A comment is your label for that version, such as the date and the reason for the change. Without a clear comment, two backups of the same GPO look identical, and in a hurry you may restore the wrong one. Keep the backup folder safe, ideally with a copy outside the single machine you are working on, and limit who can read or change it, because a backup holds the same rules that the live GPO holds. A backup that only lives on the machine that just failed is a backup you may not be able to reach when you need it most.

How restore picks a version: Restore-GPO has three useful ways to pick what comes back. Restore by name brings back the most recent backup of that GPO, which is convenient, but it is not the same as bringing back an older version. Restore by backup id brings back one specific saved version, even when it is not the most recent one, which is why recording the backup id matters. Restore with -All brings back the most recent backup of every GPO that has a backup in the folder, which is a wide action, so only use it when you truly mean every GPO. In every case, restore overwrites the current GPO with the saved version. It does not merge the old and new settings together, and it does not ask which individual settings to keep.

Why restore can fail, and what import is for: a standard restore returns a backup to the GPO it came from, in the original domain. If that original domain is not available, or if the GPO no longer exists in the domain, the restore fails. That is not a bug, it is a safety limit, because a restore is tied to the original GPO identity. Import-GPO is the safer tool for a different job. Import copies settings from a backup into a target GPO, and with -CreateIfNeeded it can create that target GPO if it does not exist yet. Import is also how you safely preview a backup, by importing it into a fresh test GPO linked only to a small test group, instead of restoring straight into a production GPO. Note the limit: import replaces the settings in the target GPO, and it does not copy the source links or security filtering, so check the target link and filtering yourself after an import.

How refresh really works, and why it is not instant magic: Invoke-GPUpdate schedules a Group Policy refresh, and gpupdate is the classic command line tool for the same job on the machine you are sitting at. A plain gpupdate applies only settings that have changed. Adding /force, or -Force in PowerShell, reapplies all policy settings, even ones that have not changed. You can also refresh only user policy or only computer policy, with -Target User or -Target Computer in PowerShell, or /target:user or /target:computer with gpupdate. A random delay can be added with -RandomDelayInMinutes, which spreads refreshes out and lowers the load on domain controllers, while a value of 0 means apply without that added delay. Some settings still need a sign out or a restart, and Invoke-GPUpdate has -LogOff and -Boot for those cases, so never use those switches casually on a machine someone else is using.

Think of it like this

Think of it like this: saving a copy of a document before you edit it. If your edit breaks the layout, you do not rewrite the whole document from memory, you open the saved copy. A GPO backup is that saved copy, and a refresh is like closing and reopening the document so the latest version shows up. But notice the limit in the analogy. Reopening a document does not fix a bad edit, it only shows you the bad edit sooner. In the same way, refreshing policy does not fix a wrong GPO setting, it only applies the wrong setting sooner. Backup fixes the definition, refresh only changes the timing, and checking the resultant set proves what actually arrived.

How it works, step by step

How it works, step by step, in order: First, write down the GPO name, where it is linked, and what you plan to change, and confirm you have permission. Second, back up the GPO with Backup-Gpo, giving its name, a backup folder that already exists, and a clear comment with the date and reason, and record the backup id from the output. Third, if the change is risky, import that backup into a fresh test GPO first, link the test GPO only to a small test group, refresh policy on a test computer, and check the resultant set there. Fourth, only then make the change in the real GPO. Fifth, refresh policy on a test computer, check the resultant set, and confirm the expected setting actually won. Sixth, if the change breaks something, restore from the backup you recorded, refresh policy again, and check the resultant set once more, so you prove the rollback worked, rather than assuming it did.

Worked example 1, back up one GPO with a comment: take Backup-Gpo -Name "Default Domain Policy" -Path "C:\GPOBackups" -Comment "Before password policy change, 2026-11-03". The -Name parameter picks the GPO to copy, and it must match exactly. The -Path parameter picks the folder that will hold the backup, and that folder must already exist. The -Comment parameter adds your label, with the reason and the date, so you can tell this backup apart from older ones later. In the output, look for DisplayName, GpoId, Id, BackupDirectory, CreationTime, and Comment. The GpoId is the GPO itself, while Id is this one backup version, and Id is the value you record for a later restore by backup id. If you change the comment, nothing about the settings changes, but your future self will thank you for a clear label when you are restoring in a hurry.

Worked example 2, back up every GPO: take Backup-Gpo -All -Path "C:\GPOBackups" -Comment "Full backup before domain wide review". The -All switch replaces -Name, and it means back up every GPO in the domain, not just one named GPO. This is useful before a wide review or a maintenance window, because you capture the whole set in one run. It is not a substitute for a single GPO backup with a sharp comment before one focused change, because a full backup folder holds many versions at once, and you must still pick the right GPO and the right backup id when you restore. If you change -All back to -Name with one GPO name, you get a smaller, clearer backup for one job, which is usually the better habit for day to day changes.

Worked example 3, preview a restore without changing anything: take Restore-GPO -Name "Default Domain Policy" -Path "C:\GPOBackups" -WhatIf. The -Name parameter picks the GPO, and -Path points at the folder holding its backups. The -WhatIf switch is the safety preview. It shows what would happen, without actually changing the GPO. Use it every time you are unsure about a restore, especially when the folder holds several backups, because it forces you to read the target name and the folder before anything is overwritten. If the preview names a GPO you did not mean, stop, check the name and the folder, and do not run the real restore yet. -WhatIf never fixes a policy, it only lets you check your aim.

Worked example 4, restore the most recent backup: take Restore-GPO -Name "Default Domain Policy" -Path "C:\GPOBackups". This restores the most recent backup of that GPO from that folder, and it overwrites the current GPO settings with the saved version. That is exactly right when your last backup was taken just before the breaking change, and it is exactly wrong when you actually need an older version, because the most recent backup may itself hold a bad change. After the restore, refresh policy and check the resultant set, so you prove the old behaviour is back. If you change -Name to a different GPO name, you restore a different GPO, so read the name twice, because a restore has no gentle undo beyond another restore.

Worked example 5, restore one specific older backup: take Restore-GPO -BackupId <YourBackupId> -Path "C:\GPOBackups". The -BackupId parameter takes the Id value from the backup output you recorded earlier, and -Path points at the folder holding that backup. Replace the placeholder with your own recorded backup id, and keep the angle brackets out of the real command. This form is the reason the backup id matters. Without it, you can only restore the most recent version, which may not be the version you want. If you paste a backup id from a different GPO, the restore will not give you the settings you expect, so check that the backup id, the GPO name in the backup output, and the target GPO all agree before you run it.

Worked example 6, preview a backup in a test GPO: take Import-GPO -BackupId <YourBackupId> -Path "C:\GPOBackups" -TargetName "Test GPO Copy" -CreateIfNeeded. The -BackupId and -Path parameters pick the saved version, just as in a restore. The -TargetName parameter names the GPO that receives the settings, and -CreateIfNeeded creates that target GPO if it does not exist yet. Use a fresh test GPO name, link it only to a small test group, and never import a backup straight into a production GPO when you only wanted a preview. Remember that import replaces the settings in the target GPO, and it does not copy the source links or security filtering, so set the test link and filtering yourself, and check them before you refresh policy on a test computer.

Worked example 7, force a refresh on your own computer: take Invoke-GPUpdate -Force. With no -Computer given, this refreshes policy on the local computer, and -Force means reapply all policy settings, not only settings that have changed. That makes it the right choice when you want to be sure a change is picked up now, rather than waiting for the next background refresh. It does not change any GPO, and it does not prove the change applied. After it finishes, check the resultant set, or run gpresult /r, to confirm the expected GPO and setting actually won. If a setting still does not appear, check whether it needs a sign out or a restart, because some settings cannot apply during a background refresh alone.

Worked example 8, refresh only user policy: take Invoke-GPUpdate -Target User -Force. The -Target parameter narrows the refresh to user policy only, while -Force still reapplies all user policy settings. Use this when your change lives in the User Configuration side of a GPO, and you do not want to disturb computer policy at the same time. If you change User to Computer, you refresh only computer policy instead, which is the right choice for a computer side change, and the wrong choice for a user side change, because the side you did not refresh will keep its old values until its next refresh. When you are unsure which side a setting lives on, refresh both sides, or leave -Target out, rather than guessing one side and wondering why nothing changed.

Worked example 9, refresh one remote computer with no added delay: take Invoke-GPUpdate -Computer "PC01" -Force -RandomDelayInMinutes 0. The -Computer parameter names the remote computer, and -Force reapplies all settings on that computer. The -RandomDelayInMinutes 0 part means do not add a random delay before the refresh starts, so the refresh is scheduled without that extra wait. This is useful for one test computer in your own lab, where you are waiting to check the result. It is not a pattern to copy for a whole domain at once, because forcing many computers at the same moment, all with no delay, can load your domain controllers. For a group, test one computer first, then roll out in small batches, and keep a delay where the default behaviour would have spread the load.

Worked example 10, the classic gpupdate form: take gpupdate /force. This is the built in command line tool version of a forced refresh, and /force means reapply all policy settings, on the machine where you run it. A plain gpupdate without /force applies only settings that have changed, which is faster and gentler, but it will not reapply a setting that Windows thinks is already applied. Use gpupdate /force when you are sitting at the affected computer and you want the same forced refresh without PowerShell. If gpupdate reports that a sign out or restart is needed, take that message seriously, because the setting will not fully apply until that step happens, no matter how many times you refresh.

When to use it

When to use it, and when not to: use a backup before every GPO change, even a small one, because small changes can have wide effects at sign in. Use a test GPO and a small group before any domain wide change, and use the resultant set after every restore and every refresh, because a refresh applies policy but does not tell you which policy won. Do not restore a backup without confirming the target GPO and the backup version, because restoring overwrites the current GPO, and restoring into the wrong GPO is a new problem, not a fix. Do not restore by name when you need an older version, and do not use -All for a restore unless you truly mean every GPO in the folder. Do not treat a backup as a full system recovery plan, and do not keep your only backup copy on the same machine you are about to change.

Common timing trap, stated plainly: after a restore, the old settings are back in the GPO definition, but clients still need to pick them up. A client that has not refreshed yet will still show the broken behaviour, and that does not mean the restore failed. Refresh policy on a test computer, check the resultant set, and only then judge the rollback. In the same way, after a backup, nothing has changed for users yet, because a backup only saves a copy. Backup, restore, and refresh are three separate steps, and skipping the check after each step is how a good rollback looks like a failed one.

Worked examples

Read each example in order. Each one explains its parts, then shows what to look for in the output.

Syntax

Syntax
Backup-Gpo -Name <Name> -Path <Folder>

Example 1

Backs up one GPO to a folder that already exists, with a dated reason in the comment, so you can pick the right version later. Do this before any change to that GPO.

Example 1
Backup-Gpo -Name "Default Domain Policy" -Path "C:\GPOBackups" -Comment "Before password policy change, 2026-11-03"

Illustrative output: DisplayName : Default Domain Policy BackupDirectory : C:\GPOBackups Comment : Before password policy change, 2026-11-03

Example 2

Backup-Gpo copies GPOs to a folder. -All means back up every GPO, not just one named GPO, using the same cmdlet and path pattern as the single GPO backup in the lesson. -Path gives the folder that will hold the backups, so you can restore from it later.

Example 2
Backup-Gpo -All -Path "C:\GPOBackups" -Comment "Full backup before domain wide review"

Illustrative output: Backup of all GPOs completed.

Example 3

Shows what a restore by name would do, without changing the GPO, so you can check the target name and backup folder before any overwrite happens.

Example 3
Restore-GPO -Name "Default Domain Policy" -Path "C:\GPOBackups" -WhatIf

Illustrative output: What if: Performing the operation "Restore GPO" on target "Default Domain Policy".

Example 4

Restores the most recent backup of that GPO from the folder, overwriting the current GPO settings. Use it only when the most recent backup is the version you want.

Example 4
Restore-GPO -Name "Default Domain Policy" -Path "C:\GPOBackups"

Illustrative output: Restore of Default Domain Policy completed.

Example 5

Restores one specific saved version, picked by the backup Id you recorded from the backup output. Replace the placeholder with your own backup Id.

Example 5
Restore-GPO -BackupId <YourBackupId> -Path "C:\GPOBackups"

Illustrative output: Restore of the selected backup completed.

Example 6

Copies backup settings into a test GPO, creating it if needed, so you can preview a backup safely. Import replaces target settings and does not copy source links or security filtering, so set those on the test GPO yourself.

Example 6
Import-GPO -BackupId <YourBackupId> -Path "C:\GPOBackups" -TargetName "Test GPO Copy" -CreateIfNeeded

Illustrative output: Import into Test GPO Copy completed.

Example 7

Forces a policy refresh on the local computer now, instead of waiting for the normal interval, and reapplies all settings, not only changed ones.

Example 7
Invoke-GPUpdate -Force

Illustrative output: Policy refresh completed.

Example 8

Refreshes only user policy, with all user settings reapplied. Change User to Computer when the change lives on the computer side of a GPO.

Example 8
Invoke-GPUpdate -Target User -Force

Illustrative output: User policy refresh completed.

Example 9

Schedules a forced refresh on one named remote computer, with no added random delay. Test one computer first, and do not force a whole domain at once with no delay.

Example 9
Invoke-GPUpdate -Computer "PC01" -Force -RandomDelayInMinutes 0

Illustrative output: Policy refresh scheduled for PC01.

Example 10

The built in command line form of a forced refresh on the machine where you run it. A plain gpupdate without /force applies only changed settings.

Example 10
gpupdate /force

Illustrative output: Policy refresh completed.

Nothing on this page executes PowerShell code. The outputs above are illustrative only.

Common mistakes and troubleshooting

Read these before you try the examples, so you can spot the same problems in your own work.

  • Changing a GPO without a backup, then discovering the change broke sign in for many users at once.
  • Refreshing policy and assuming the change applied, without checking the resultant set or the sign in and restart needs of that setting.
  • Keeping several backups in one folder with no date or reason in the comment, then restoring the wrong backup in a hurry and overwriting a good GPO with an older one.
  • Restoring by name when you actually need an older version, and getting the most recent backup instead, which may already hold the bad change.
  • Restoring into the wrong GPO, or restoring with -All when you only meant one GPO, and overwriting settings you never intended to touch.
  • Assuming a backup also restores links, link order, and filtering on its own. Record those separately, and check them again after a restore.
  • Importing a backup into a production GPO to preview it, and learning too late that import replaces the target settings, instead of importing into a fresh test GPO linked only to a small test group.
  • Trying to restore a backup into a different domain, or after the original GPO was deleted, and expecting a standard restore to work, when that case needs an import into a new GPO instead.
  • Forcing a refresh on a whole domain at once with no delay, then judging the change on a computer that has not refreshed yet, or on a setting that still needs a sign out or restart.

Knowledge check

Knowledge check

Why back up a GPO before changing it?

Pick one answer. Feedback appears right away, and you can try again.

Remember this and next step

Remember this: backup before you change, test on a small group before you roll out wide, refresh after you change, and check the resultant set after every step. Record the backup id and a clear comment every time, preview a restore with -WhatIf when you are unsure, and use import into a test GPO when you want to look at a backup without touching production. That short habit turns a scary GPO edit into a reversible one, and it keeps one bad change from becoming a domain wide problem.

Next step: Internet: get content from a web page