Backup GPO - PowerShell


Backup-GPO creates a backup of a Group Policy Object (GPO) on a specified server. The backup file can be used to restore the GPO in case it is deleted or corrupted.


Backup-GPO [-Name] <String> [-Path] <String> [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]


The name of the GPO to back up.

The path to the folder where the backup file will be created.

Overrides the default behavior of prompting for confirmation before overwriting an existing backup file.

Performs a simulation of the command without actually performing the backup.

Prompts for confirmation before executing the command.


Simple Backup

Backup-GPO -Name "MyGPO" -Path "C:\GPOBackups"

Complex Backup

Backup-GPO -Name "MyGPO1" -Path "C:\GPOBackups\MyGPO1.bak" -Force -WhatIf

Common Issues

  • GPO not found: Ensure that the specified GPO name exists on the server.
  • Insufficient permissions: Verify that the user running the command has sufficient permissions to back up the GPO.
  • Overwriting existing backup: Use the -Force option to overwrite an existing backup file without prompting for confirmation.


Backup-GPO can be used in conjunction with other PowerShell commands to automate GPO backup tasks. For example, the following script backups all GPOs on a server and saves the backups to a designated folder:

Get-GPO -All | Backup-GPO -Path "C:\GPOBackups\"
  • Export-GPO – Exports a GPO to an XML file.
  • Restore-GPO – Restores a GPO from a backup file.