Script that extracts Windows registry to a csv file(s)

Hello,

I am looking for a way to extract all of the registry settings of two windows 10 machines into csv files so that I can compare two differences. Does anyone know how this could be done via powershell? I am kind of lost so any suggestions help, thank you!

that’ll be too much, you can export the registry hives in UI and compare it with Beyondcompare or any other comparison tool, that’ll be easier.

What @kvprasoon said is correct, but this could help you to some extent…

[pre]

$RegOnComp01 = Invoke-Command -ComputerName Comp01 -ScriptBlock {Get-ChildItem HKCU:\ -Recurse -ErrorAction SilentlyContinue}
$RegOnComp02 = Invoke-Command -ComputerName Comp02 -ScriptBlock {Get-ChildItem HKCU:\ -Recurse -ErrorAction SilentlyContinue}
Compare-Object -ReferenceObject $RegOnComp01 -DifferenceObject $RegOnComp02

[/pre]

also with HKLM:\ as well.

Thank you.

Thanks for the answers.

One more question! What if I wanted to do the exact same thing with Local Group Policies?

Would there be an easy way to extract them into a CSV via powershell?

AFAIK, PowerShell doesn’t built in have capability to handle local group policies yet. You can use lgpo.exe, it can produce a text file with the relevant configs, then you can compare.