I have a backup of a GPO and I"d like to bring it back to run some tests. I have a script that works for a friend in the field, but it's not working for me.
This is the Powershell code:
Powershell
Import-Module-NamegrouppolicyNew-item-ItemTypedirectory-PathC:\GPOBackup$LDAPRoot=[ADSI]"LDAP://RootDSE"$GPLinkTarget=$LDAPRoot.Get("rootDomainNamingContext")Backup-GPO-All-PathC:\GPOBackupNew-GPO-name"TestGPO"-comment"This is another test."Import-GPO-BackupId23060B46-BE69-4151-88F3-C87D67890623-TargetName"TestGPO"-Path$PSScriptRootNew-GPLink-name"TestGPO"-EnforcedYes-LinkEnabledYes-Target$GPLinkTargetThis is the Error I get when running it:
Powershell
New-GPO:Accessisdenied.(ExceptionfromHRESULT:0x80070005(E_ACCESSDENIED))AtC:\GPOBackup\run\ImportCryptolockerPolicies.ps1:6char:1+New-GPO-name...