Imports the Group Policy settings from a backed-up GPO into a specified GPO.
Active Directory · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft GroupPolicy reference: Imports the Group Policy settings from a backed-up GPO into a specified GPO. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Import-GPO. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / GroupPolicy · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-BackupGpoName (required)
Specifies the display name of the backed-up GPO from which this cmdlet imports the settings. The most recent backup of the GPO is used. You can use the BackupID parameter to specify a particular version to use when multiple backups of the same GPO exist in the backup directory. You can also refer to the BackupGpoName parameter by its built-in alias, DisplayName. For more information, see about_Aliases.
-BackupId (required)
Specifies the backup ID of a GPO backup. The backup ID is a globally unique identifier (GUID) that uniquely identifies the backup. You can use this parameter to specify a particular version of a backed-up GPO in the backup directory. The backup ID is different from the ID of the GPO that was backed up. You can also refer to the BackupID parameter by its built-in alias, Id. For more information, see about_Aliases.
-Confirm
Prompts you for confirmation before running the cmdlet.
-CreateIfNeeded
Indicates that the cmdlet creates a GPO from the backup if the specified target GPO does not exist.
-Domain
Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain. For the Import-GPO cmdlet, this is the domain into which you want to import the GPO. If you do not specify the Domain parameter, the domain of the user that is running the current session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain of the computer is used. For more information, see the Notes section in the full Help. If you specify a domain that is different from the domain of the user that is running the current session (or, for a startup or shutdown script, the computer), a trust must exist between that domain and the domain of the user, or the computer. You can also refer to the Domain parameter by its built-in alias, DomainName. For more information, see about_Aliases.
-MigrationTable
Specifies the path to a migration table file. You can use a migration table to map security principals and UNC paths across domains.
-Path (required)
Specifies the path to the backup directory. You can also refer to the Path parameter by its built-in aliases: BackupLocation or BackupDirectory.
-Server
Specifies the name of the domain controller that this cmdlet contacts to complete the operation. You can specify either the fully qualified domain name (FQDN) or the host name If you do not specify the name by using the Server parameter, the primary domain controller (PDC) emulator is contacted. You can also refer to the Server parameter by its built-in alias, DC.
-TargetGuid
Specifies the GUID of the GPO into which this cmdlet imports the settings. Use the *CreateIfNeeded* parameter to force the GPO to be created if it does not already exist in the domain. You must specify either the TargetGuid parameter or the TargetName parameter.
-TargetName
Specifies the display name of the GPO into which the settings are to be imported. Use the CreateIfNeeded parameter to force the GPO to be created if it does not already exist in the domain. You must specify either the TargetGuid parameter or the TargetName parameter.
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Prerequisites
Windows with the GroupPolicy module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
Examples
Example 1: Import the settings from the latest backup to another directory in the same domain
This command imports the settings from the most recent backup of the GPO named TestGPO in the c:\backups directory into a GPO of the same name in the current domain. If a GPO named TestGPO does not exist in the current domain, the command fails because the CreateIfNeeded parameter is not specified. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.