GPO Backup and Report script

PowerShell script to periodically back up the Group Policy and documentation of version using HTML reports. Ideal as a scheduled task to perform regular backups of the GPO. Each backup creates a new subfolder with a time stamp.Only the variable $path must be adjusted to the desir

 
 
 
 
 
5 Star
(9)
1,595 times
Add to favorites
Group Policy
3/13/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Keep getting an error on the first GPO
    1 Posts | Last post July 25, 2019
    • Not sure why but it errors out on the Default Domain Policy every time I run this:
      
      PSMessageDetails      : 
      Exception             : System.Runtime.InteropServices.COMException (0x800710D2): The library, 
                              drive, or media pool is empty. (Exception from HRESULT: 0x800710D2)
                                 at Microsoft.GroupPolicy.GPMResultClass.OverallStatus()
                                 at Microsoft.GroupPolicy.Gpo.Backup(String directory, String comment, 
                              GPStatusMessageCollection& statusMessages)
                                 at Microsoft.GroupPolicy.Commands.BackupGpoCommand.ProcessRecord()
                                 at System.Management.Automation.CommandProcessor.ProcessRecord()
      TargetObject          : 
      CategoryInfo          : NotSpecified: (:) [Backup-GPO], COMException
      FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.GroupPolicy.Commands.
                              BackupGpoCommand
      ErrorDetails          : 
      InvocationInfo        : System.Management.Automation.InvocationInfo
      ScriptStackTrace      : at <ScriptBlock>, C:\Apps\GPOBackups\get-GPOBackup.ps1: line 223
                              at <ScriptBlock>, <No file>: line 1
      PipelineIterationInfo : {}
      
      
      
      Default Domain Policy Backup failed
      
      
      Any ideas why?  Love the script!
      
      Steve
  • Why this error?
    2 Posts | Last post March 03, 2018
    • 
      Get-EventLog : No matches found
      At C:\scripts\bk\get-GPOBackup.ps1:125 char:8
      +   if(( Get-EventLog -LogName Application -Source "GPObackup").count -eq 0)
      +        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (:) [Get-EventLog], ArgumentException
          + FullyQualifiedErrorId : GetEventLogNoEntriesFound,Microsoft.PowerShell.Commands.GetEventLogCommand
      
      
      
      In Eventlog:
      
      Backup of GPO failed. Error [The system cannot find the path specified.
      ].
       Details -
           Source GPO:
                DisplayName: WIN WSUS MX-INFRA
                ID: {0065D46C-AF0B-4F43-B9ED-01A1E387D8C0}
                Domain: xxx.xxxx
        
            Backup:
               Directory: .\
               Instance : {0FEEC9C1-3977-43D6-A9B3-FAF1038EEBA3}
               Comment  : 
      
    • Hi Zhiaga, thake the new Version, ther is an issue with some Characters in GPO names, also with a Space. Version 1.55 is fixing this. If it help, please Vote for this script.
  • Error out on GPO's with ":"
    2 Posts | Last post March 03, 2018
    • Fabian, great script thanks!  Just a note script errors out on GPO's with colon (:) character in it - line 101:3 New-Item, which makes sense why because the path is not valid in Window FS.  Maybe put a check into your script for it?  If not just a quick statement.
    • Hi bpierce, take the new version, there is a fix for Unwanted characters. I hade the same issue at a customer side.