-3

I would like to access remotely to the registry of a Windows machine to see some keys under "SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" with a Powershell script

I already tried to open a PSSession but it doesn't work. Is any other solution to do this ?

gerem
  • 33
  • 1
  • 3
  • 1
    `I already tried to open a PSSession but it doesn't work.` The error you get would be helpful. Also a quick Google search for "powershell remote registry" turns up at least 2-3 other possible solutions that don't involve PSSession. – GregL Nov 02 '15 at 13:14
  • Powershell really is not the best tool to work a remote registry. Assuming the Windows firewall is off, you should be able to connect to another machine through Windows itself. Is this a workstation or server OS? – Jonas Lear Nov 02 '15 at 17:49

1 Answers1

1
$Computer = "RemoteComputerName"

$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computer)
$RegKey= $Reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SoftwareProtectionPlatform")
$RegValue = $RegKey.GetValue("UserOperations")

Make sure that RemoteRegistry Service is Enabled and Started on the remote machine, to change the registry hive, use one of this:

https://msdn.microsoft.com/en-us/library/ctb3kd86(v=vs.110).aspx

Avshalom
  • 161
  • 7