Skip to main content

Restore-RegistryValue

Overview

This document explains how to restore a backed-up registry key property or registry key recursively when backed up with Backup-RegistryValue.ps1.

Requirements

  1. The EPM - Windows Configuration - Agnostic - Script - Backup-RegistryValue must have been used to back up the registry value.
  2. The script must be run with Admin Rights.

Process

  1. Retrieve the necessary information for the key properties (or keys and all associated properties) being restored.
  2. Restore the key property or key properties to their original registry location.
  3. Verify that the two keys match.
    1. If the removal of the backup is desired, remove the backup key.

Payload Usage

To restore the backed-up key property to its original registry location and remove the backed-up key property when finished, use the following command:

Restore-RegistryValue.ps1 -Path "HKLM:\\Software\\_automation\\WindowsUpdate\\Windowsversion" -Name Windowsversion -RemoveOnRestore

To restore the backed-up key property and all recursive keys and properties to their original registry locations, use the following command:

Restore-RegistryValue.ps1 -Path "HKLM:\\Software\\_automation\\WindowsUpdate\\Windowsversion"

Parameters

ParameterAliasRequiredDefaultTypeDescription
-PathTrueStringThe path to the backed-up registry key.
-NameTrueStringThe original path of the backed-up key.
-RemoveOnRestoreFalseFalseBoolDesignates removal of the backed-up key after successful restore.

Output

Does the content write to the RMM log, a data file, or the console? If so, what is the syntax?

./Restore-RegistryValue-log.txt
./Restore-RegistryValue-error.txt

Locations

PayloadPath
Restore Script/repo/script/Restore-RegistryValue.ps1
Automate
ConnectWise RMM
Kaseya
Datto RMM

Attachments

Install-AnyConnect.ps1