PowerShell Tool – Backup Group Policy Objects (GPO) linked to Oranizational Units (OU)
When editing Group Policy Objects you should always be aware of taking backups before changing anything. But from time to time you need to backup not just one GPO. This could be easyly managed by MS standard tools. Sometimes you need to backup all GPOs that are linked to a Organizational Unit. There is no GUI tool from Microsoft supporting this case, therefore I’ve built a small PowerShell script that will support you.
The script is easy to handle. Just start it and select the OU your policies are linked to. The script will start backup of your linked GPOs (recursively).
I’ve used the “Active Directory OU picker” from “MicaH’s IT blog” for easy OU selection.
This is the first release. Be carefull when using it in productive environments.
Always test before using in production!
Start the script by running .\AD_Backup_GPO.ps1
The script will automatically check if all requirements are met.
Select the OU you like to Backup. The script will also Backup all linked gpo beneath your selection.
In this example all GPO beneath “Computers” will be covered.
Organizational Units beneath your selected OU will be automatically detected and selected for backup.
In this case this are the OUs “Desktop”, “Notebook”, “Special” and “VDI”.
The backup process will start.
A summary will show if everything went fine.
Your backup will be located in AD_GPO_Backup\GPO_Backups\%Date%_%Time%\