Import Registry Hive

1

I have a set of "Registry Hive Files (.)" that am attempting to import via PowerShell. The goal is to have the script run across many machines in the environment and not have to manually do it via RegEdit on each machine.

Is there a way to import hive files via PowerShell?

Trying "regedit.exe hivefile" does not work. These hive files are going in HKLM.

Jonathan Mabrito

Posted 2015-11-18T20:55:27.013

Reputation: 11

1The answer will depend a little bit on your environment. Basically the way I do this typically is to remotely execute *reg.exe /I <FILENAME>*. How you remotely execute it depends on your environment. If you have remoting available on all the remote machines you can use Enter-PSSession. If not you could use a utility like pscexec.exe – EBGreen – 2015-11-18T21:08:54.800

1Are you on a domain? If so, use Group Policy Preferences instead. Or perhaps just use standard Group Policies and a computer start-up script containing a one-line batch reg import yourfile.reg or regedit /s yourfile.reg. – Ƭᴇcʜιᴇ007 – 2015-11-18T21:29:56.850

Also, you say "Trying "regedit.exe hivefile" does not work." In what way does it "not work"? – Ƭᴇcʜιᴇ007 – 2015-11-18T21:31:24.257

Answers

0

I actually found the REG RESTORE command. This command did the trick and I was able to get the HIVE file imported successfully.

Jonathan Mabrito

Posted 2015-11-18T20:55:27.013

Reputation: 11