GPO Backup and Email of GPO Modifications

Recently I wrote a Powershell script that backs up Group Policies and also sends an email of Group Policies modified within a specified time.  Works well setup on a scheduled task to take care of GPO Backups.

Download Here: GPO_Backup_1.2

The following fields can be modified to suite your requirements

$BUlocation = "C:\GPOBackups" #where the GPOs Backups will be located
$BUresults = "Backup-results.txt" #name of the ouput file (for reference)
$days = 15 #number days old bacups to be auto deleted
$dc = "domaincontroller" #hostname of the DC for backing up
$SMTPserver = "smtp.domain.com" #SMTP server name
$SendTo = "reciepient@domain.com" #Send email to this address

Also for the email sent you can change how long to capture the modifications

eg. 24 Hours

$body = Get-GPOModifications -Hours 24

eg. 7 Days

$body = Get-GPOModifications -Days 7

Hope you find this one useful 🙂

Leave a Reply

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