Create or Modify registry key values remotely

Did you ever wanted to modify your registry or add a key/value pair to registry? Wished there was a script to help you do that? Even better, wished it can run remotely without PowerShell WinRM listener configured on target server?I had custom script that would modify certain regi

4.4 Star
6,277 times
Add to favorites
Operating System
E-mail Twitter Digg Facebook
  • You cannot call a method on a null-valued expression.
    1 Posts | Last post May 10, 2017
    • I have noticed that the script is set to create the key if it doesn't exist in order to be able to create the value under said key.
      However, the script is not getting the correct name of the key.  Instead, it gets a blank name and throws a null value error.  There error is here:
      		$Key -match ".*\x5C(\w*\z)" | Out-Null
      Change this to:
      		$Key -match ".*\x5C(.*)" | Out-Null
      Now the script will create the the key if it doesn't exist.  It only fails if the parent key of the parent key doesn't exist, if that makes sense.
  • AppData
    1 Posts | Last post May 19, 2014
    • How would I make this script to modify the following registry:
      HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
      AppData= %USERPROFILE%\AppData\Roaming?
  • 32 bit and 64 bit if clause
    1 Posts | Last post September 20, 2013
    • Great script, how could i run this against a list of computers that comprised of 32 bit and 64 bit machines that needed a reg key changed but with an if clause if the key value required to be changed was in the syswow64 section on 64 bit machines and the normal software section on 32 bit machines
  • Remote Registry Disable Scenario
    2 Posts | Last post May 09, 2013
    • Nice Script. I believe this script works when "Remote Registry" service is running. In our environment, we disable this service. Is there any way I can achieve same result when Remote Registry is disabled?
    • Unfortunately no. Registry can only be changed remotely if the service is running.
  • Can this script be used to remove a registry value?
    2 Posts | Last post August 22, 2012
    • I need to be able to remove a registry value to work around issues installing MS update KB2686509 which requires a particular value be remove from registry prior to installing the update then added back after installing.
    • Unfortunately not. Delete operation can be disastrous if used incorrectly so I intentionally left delete out of this script. It only works for create and modify operations. Sorry.
  • run script to change on many computers
    2 Posts | Last post January 10, 2012
    • Great script! Works terrific on local or single remote computer. What would be the best method to run this script against a listing of computer names in a .txt file?
      Then pipe the output (either successful or unsuccessful) for each computer to a different .txt file?
      Any guidance is appreciated!
    • You should be able to use get-content (your filename here).txt | ForEach {Set-RemoteRegistry.ps1 | out-file $_.txt}.
      I haven't tested above syntax, please correct as necessary.
  • Suggestion
    2 Posts | Last post October 31, 2011
    • There's no telling how many people have written an advanced function similar to this one, but I think you are the first to post one with this many features.  One suggestion might want to change your $Server parameter to $ComputerName to match the standard that Microsoft uses for PowerShell commands.
    • Corrected the script and updated post. Thanks for suggestion!