How to backup and restore Group Policy Objects in Active Directory using PowerShell scripts?

Read on to know how to backup and restore Group Policy Objects (GPO) with PowerShell scripts in Active Directory (AD) and how you can get it done easily with ADManager Plus.

Windows PowerShell

Backing up GPOs:

  • Identify the domain for which the GPOs need to be backed up.
  • Create and compile the script for backing up GPOs. Execute the script in PowerShell.
  • Sample script for backing up the GPOs:
 Copied
PS C:\> Backup-Gpo-All-Path "C:\Users\Administrator\Documents\Scripts"
Click to copy entire script

Restoring GPOs:

  • Identify the domain for which the GPOs need to be backed up.
  • Create and compile the script for backing up GPOs. Execute the script in PowerShell.
  • Sample script for restoring GPOs in Active Directory:
 Copied
PS C:\> Restore-Gpo -Name "Admins" -Path "C:\Users\Administrator\Documents\Scripts"
Click to copy entire script

ADManager Plus

Backing up GPOs:

  • Navigate to Backup> Settings > Backup Settings .
  • Select the GPOs and the frequency at which you want the backups to occur. Then click save.
  • You can even export the reports as CSV, PDF, XLSX or HTML.

Screenshot

Backup Group Policy Objects using ADManager Plus

Restoring GPOs:

  • Navigate to Backup> Active Directory > Restore.
  • Select the GPO(s) you wish to restore. Then click Restore.

Screenshot

Restore Group Policy Objects using ADManager Plus

» Start 30-day Free Trial

Although backing up and restoring GPOs with native tools like PowerShell looks simple, it comes with a few limitations:

  • PowerShell script can be run only from the computers which have the Active Directory Domain Services role installed in them.
  • Need for a new script, in case other AD objects need to be backed up or restored needs to be exported.
  • The syntax, parameters and iterations need to be correct. A typo or incorrect syntax might be difficult to spot and rectify, especially when the script is a long one.

ADManager Plus lets you perform the same with a few clicks from its web based GUI console. It also lets you restore AD objects even after their tombstone period.

Protect against accidental deletions and undesired changes with AD backup and restore.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
     
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link