PowerShell Logo Small

Restore-GPO



This is the built-in help made by Microsoft for the command 'Restore-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

Restores one GPO or all GPOs in a domain from one or more GPO backup files.

SYNTAX


Restore-GPO [-Domain <String>] [-Server <String>] -BackupId <Guid> -Path <String> [-Confirm] [-WhatIf] [<CommonParameters>]
Restore-GPO [-Domain <String>] [-Server <String>] -All -Path <String> [-Confirm] [-WhatIf] [<CommonParameters>]
Restore-GPO [-Domain <String>] [-Server <String>] -Guid <Guid> -Path <String> [-Confirm] [-WhatIf] [<CommonParameters>]
Restore-GPO [-Name] <String> [-Domain <String>] [-Server <String>] -Path <String> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Restore-GPO cmdlet restores a GPO backup to the original domain from which it was saved. If the original domain is not available, or if the GPO no longer exists in the
domain, the cmdlet fails.


You can:

-- Use the Guid parameter or the Name parameter to restore a GPO from its most recent backup.

-- Use the All parameter to restore all GPOs in the domain from their most recent backups.

-- Use the BackupId parameter to restore a GPO from a specific backup. This parameter enables you to restore a GPO from a backup prior to the most recent one.



<

RELATED LINKS

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

REMARKS

<

Examples


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

C:\PS>Restore-GPO -Name "TestGPO" -Path \\Server1\Backups



Description

-----------

This command restores the GPO named TestGpo from the \\Server1\Backups directory. The most recent backup is restored.




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

C:\PS>Restore-GPO -GUID fa4a9473-6e2a-4b87-ab78-175e68d97bde -Path \\Server1\Backups



Description

-----------

This command restores the GPO with the GUID fa4a9473-6e2a-4b87-ab78-175e68d97bde from the \\Server1\Backups directory. The most recent backup is restored.




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

C:\PS>Restore-GPO -All -Domain contoso.com -Path \\Server1\Backups



Description

-----------

This command restores all of the GPOs in the contoso.com domain previously backed up to \\Server1\Backup. Each GPO is restored using its most recent backup.

If the domain of user that is running the session (or, for a startup or shutdown script, the domain of the computer) is different from the contoso.com domain, a trust must
exist between the two domains or the command fails.




-------------------------- EXAMPLE 4 --------------------------

C:\PS>Restore-GPO -BackupId 0fc29b3c-fb83-4076-babb-6194c1b4fc26 -Path \\Server1\Backups



Description

-----------

This command restores a GPO from the backup specified by the BackupId parameter. The BackupId parameter can be used to restore a GPO from a backup prior to the most recent
backup.