• Exporting & Migrating GPOs with PowerShell

    by  • February 18, 2016 • Active Directory, PowerShell, Scripting • 0 Comments

    In more than one project, I have run across the desire to export GPOs that I have created and re-import them. While this can be easily accomplished by customers who have access to AGPM by following MSFT’s Guide, this is not always the case. The following is an alternative way that will work with any environment as it is PowerShell based.

     

    GPO Export

    Start PowerShell and Import the Group Policy module:

    Run the Following Command to the Directory you want to export Powershell command:

    I.E. Exporting a GPO called “Pablo GPO” to the directory C:\GPOs


     

    GPO Import

    When it coms to the import, it can be easily accomplished by running the following command:

    I.E. Importing the “Pablo GPO” from the directory C:\GPOs

     

    Additionally, you can use the  -TargetName flag to change the name of the GPO when importing it.

    I.E. Importing the “Pablo GPO” from the directory C:\GPOs and renaming it to “Corporate GPO”

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.