I would suggest on your own machine and target machines that you verify that service is running. In order for a key to be opened remotely, both the server and client machines must be running the remote registry service, and have remote administration enabled. One of the is that the remote registry service needs to be running. I think your issue is the error is misleading. You can see what happens in the picture below. I decided to isolate this line and just run it in PowerShell. The application uses the OpenRemoteRegistryKey method in. When I was debugging the program, it turned out that it gives an error whenever the input I provide is either 'localhost' or '127.0.0.1', but it works when I provide 'mxcz', which is my computer name. The user can provide a hostname or IP in a string and should be getting a registry value displayed on their screen. I'm trying to write an application that will get some registry values from a remote computer. At 32ErrorStatic(Int32 errorCode, String str) at (RegistryHive hKey, String machineName) It seems pretty clear that this is because the user I'm running the powershell script as doesn't have the appropriate credentials to access the remote.