Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Trying to import a GPO with powershell, from a backup

$
0
0

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$GPLinkTarget

This 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...

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>