Creating new registry key values on remote computers using PowerShell

Have you never needed to create some new registry key values on some remote computers? I’ll bet you have. Watch PowerShell come to the rescue with this script contributed by Ying Li to Rod Trent’s myITforum:

$colComputers = gc c:\myworkspace\computerlist.txt
foreach ($strComputer in $colComputers)
{
#Open remote registry
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(?LocalMachine?, $strComputer)
#Open the targeted remote registry key/subkey for read and write ($True)
$regKey= $reg.OpenSubKey(“SOFTWARE\\Whatever\\General”,$True)
#Create a new (string)value ??Override System Verification? and assign ?Yes? to it
$regKey.Setvalue(?Override System Verification?, ?Yes?, ?String?)
}

Here’s a link to Ying Li’s original post on myITforum:
http://www.wservernews.com/go/1328946307046

The above tip was previously published in an issue of WServerNews, a weekly newsletter from TechGenix that focuses on the administration, management and security of the Windows Server platform in particular and cloud solutions in general. Subscribe to WServerNews today by going to http://www.wservernews.com/subscribe.htm and join almost 100,000 other IT professionals around the world who read our newsletter!

Mitch Tulloch is an eleven-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows Server and cloud computing technologies.  Mitch is also Senior Editor of WServerNews. For more information about him see http://www.mtit.com.

About The Author

2 thoughts on “Creating new registry key values on remote computers using PowerShell”

  1. Please ignore this tip, it’s one from 6 years ago that just got republished here for some reason and the formatting is screwed up. See the original script sample from Ying Li on myITforum for correct formatting.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top