PowerShell Logo Small

Import-GPO



This is the built-in help made by Microsoft for the command 'Import-GPO', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Imports the Group Policy settings from a backed-up GPO into a specified GPO.

SYNTAX


Import-GPO [-CreateIfNeeded] [-Domain <String>] [-MigrationTable <String>] [-Server <String>] [-TargetGuid <Guid>] [-TargetName <String>] -BackupId <Guid> -Path <String>
[-Confirm] [-WhatIf] [<CommonParameters>]
Import-GPO [-CreateIfNeeded] [-Domain <String>] [-MigrationTable <String>] [-Server <String>] [-TargetGuid <Guid>] [-TargetName <String>] -BackupGpoName <String> -Path
<String> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Import-GPO cmdlet imports the settings from a GPO backup into a specified target GPO. The target GPO can be in a different domain or forest than that from which the
backup was made and it does not have to exist prior to the operation.


Use the Path parameter to specify the location of the backup and then use the BackupGpoName parameter to specify the GPO name of the backup to use, or the BackupId parameter
to specify the backup ID (GUID) of the backup to use.


Note that if you specify a GPO name, the cmdlet imports the most recent backup. To import an earlier version of a GPO backup, you must use the BackupID parameter to specify
the unique backup ID for the particular version. This is the GUID that uniquely identifies the backup within its backup directory.


Use the TargetName parameter or the TargetGuid parameter to specify the target GPO into which the settings should be imported. Use the optional MigrationTable parameter to
map security principals and UNC paths across domains. Use the CreateIfNeeded parameter to create a new GPO if the specified target GPO does not exist.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?linkid=287722
Backup-GPO
Restore-GPO

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>import-gpo -BackupGpoName TestGPO -TargetName TestGPO -path c:\backups

DisplayName : TestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 87d38d82-cc2d-4bf7-ad9f-4083a60316eb
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 3/3/2009 1:03:28 PM
ModificationTime : 3/6/2009 5:03:29 PM
UserVersion : AD Version: 9, SysVol Version: 9
ComputerVersion : AD Version: 5, SysVol Version: 5
WmiFilter :



Description

-----------

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.




-------------------------- EXAMPLE 2 --------------------------

C:\PS>import-gpo -BackupId A491D730-F3ED-464C-B8C9-F50562C536AA -TargetName TestGPO -path c:\backups -CreateIfNeeded

DisplayName : TestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 87d38d82-cc2d-4bf7-ad9f-4083a60316eb
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 3/3/2009 1:03:28 PM
ModificationTime : 3/6/2009 5:11:49 PM
UserVersion : AD Version: 10, SysVol Version: 10
ComputerVersion : AD Version: 6, SysVol Version: 6
WmiFilter :



Description

-----------

This command imports the settings from the specified backup in the c:\backups directory into a GPO that is named TestGPO in the current domain. The BackupId parameter is
used to specify the GUID of the GPO backup to use. Because the CreateIfNeeded parameter is specified, if a GPO named TestGPO does not exist in the current domain, one is
created before the settings are imported.




-------------------------- EXAMPLE 3 --------------------------

C:\PS>Import-GPO -BackupGpoName TestGPO -Path D:\Backups -TargetName NewTestGPO -MigrationTable D:\Tables\Migtable1.migtable -CreateIfNeeded

DisplayName : NewTestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 87d38d82-cc2d-4bf7-ad9f-4083a60316eb
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 3/3/2009 1:03:28 PM
ModificationTime : 3/6/2009 5:11:49 PM
UserVersion : AD Version: 1, SysVol Version: 1
ComputerVersion : AD Version: 1, SysVol Version: 1
WmiFilter :



Description

-----------

This command imports the settings from the most recent backup of the GPO named TestGPO from the d:\backups directory to a GPO named NewTestGPO in the current domain. The
specified migration table is used to migrate security principals and UNC paths to the new GPO. Because the CreateIfNeeded parameter is specified, the GPO is created if it
does not already exist.