Unable to clone Group Policy using the Powershell command?

0

I Need to re-create or clone the Group Policy using other names with the below script:

$GPOName = 'Default Domain Policy'
$BackupPath = "$($env:USERPROFILE)\Desktop\BACKUP\$($GPOName)"

Backup-GPO -Name $GPOName -Path $BackupPath -Verbose
Restore-GPO -Name "$GPOName - (CLONE)" -Path $BackupPath -Verbose
Remove-Item -Path $BackupPath -Force -Recurse

However, it is failed with the below error:

Backup-GPO : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At line:5 char:1

  • Backup-GPO -Name $GPOName -Path $BackupPath -Verbose
  •   + CategoryInfo          : NotSpecified: (:) [Backup-GPO], FileNotFoundException
      + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.GroupPolicy.Commands.BackupGpoCommand
    
powershell
active-directory
group-policy

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0