Creating new registry key values on remote computers using PowerShell

by Mitch Tulloch [Published on 5 Aug. 2015 / Last Updated on 5 Aug. 2015]

A tip on how you can use Windows PowerShell to script the creation of registry key values on remote computers.

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.

See Also


The Author — Mitch Tulloch

Mitch Tulloch is a well-known expert on Windows Server administration and cloud computing technologies. He has published over a thousand articles on information technology topics and has written, contributed to or been series editor for over 50 books.

Featured Links