Backup-GPO

Backup individual group policy objects (GPOs) or all the GPOs in a domain.

Syntax
      Backup-GPO [-Name] string -Path string
         [-Comment string] [-Domain string] [-Server string] [CommonParameters]

      Backup-GPO -All -Path string
         [-Comment string] [-Domain string] [-Server string] [CommonParameters]

      Backup-GPO -Guid <Guid> -Path string
         [-Comment string] [-Domain string] [-Server string] [CommonParameters]

Key
   -All  Backup all GPOs in the domain.

   -Comment string 
         Include a comment for the backed-up GPO.

   -Domain string
         The domain containing the GPOs to backup, requires a trust relationship if not the current domain.

   -Guid Guid
         Specify the GPO to backup by its globally unique identifier (GUID).

   -Name string
         Specify the display name of the GPO to backup.

   -Path string
         The path to the backup directory; for example, "C:\Backups" or "\\Server64\Backups".

   -Server string
         The name of the domain controller that should complete the operation.
         Specify either a fully qualified domain name (FQDN) or the host name.
         For example: 
         FQDN:      DomainController1.europe.ss64.com
         Host Name: DomainController1

The current/default domain is that of the user that is running the session or, for startup and shutdown scripts, the computer.

Examples

Back up the "SS64" GPO to the C:\GpoBackups directory:

PS C:\> Backup-GPO -Name SS64 -Path C:\GpoBackups -Comment "Weekly Backup"

Back up the GPO with the specified GUID:

PS C:\> Backup-GPO -GUID 3a4a6473-6b2a-4c84-ab78-175e68d64bdf -Domain ss64.com -Server DC1 -Path \\Server64\GpoBackups

Back up all the GPOs in the current domain to \\Server64\GpoBackups:

PS C:\> Backup-GPO -All -Path \\Server64\GpoBackups

“ For God’s sake build not your faith upon Tradition, 'tis as rotten as a rotten Post” ~ Nicholas Culpeper

Related PowerShell Cmdlets

Restore-GPO - Restore one or all GPOs from a GPO backup.
Import-GPO - Import Group Policy settings into a specified GPO from a GPO backup.
Copy-CPO - Copy a Group Policy Object.


 
Copyright © 1999-2024 SS64.com
Some rights reserved