Exporting and Importing Group Policy Objects via PowerShell

Start powershell and import the Group Policy Cmdlet:

powershell

import-module grouppolicy

Exporting GPO’s

Specific GPO

Backup-GPO -Name <GPOName> -Path <BackupDirectoryPath>

Example: to backup a GPO called “Example GPO” to the directory “C:GPOBackup”

Backup-GPO -Name “Example GPO” -Path “C:GPOBackup”

All GPO’s

Backup-GPO -All -Path <BackupDirectoryPath>

Example: to backup a GPO called “Example GPO” to the directory “C:GPOBackup”

Backup-GPO -All -Path “C:GPOBackup”

 

Importing GPO’s

Keep GPO Name

Import-GPO -BackupGPOName <GPOName> -CreateIfNeeded -Path <BackupDirectoryPath>

Example: to import a GPO called “Example GPO” from the directory “C:GPOBackup”

Import-GPO -BackupGPOName “Example GPO” -CreateIfNeeded -Path “C:GPOBackup”

New GPO Name

Import-GPO -BackupGPOName <GPOName> -TargetName <NewGPOName> -CreateIfNeeded -Path <BackupDirectoryPath>

Example: to import a GPO called “Example GPO”, renaming it to “New GPO”, from the directory “C:GPOBackup”

Import-GPO -BackupGPOName “Example GPO” -TargetName “New GPO” -CreateIfNeeded -Path “C:GPOBackup”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s