Remote Registry should "just work" (no WinRM dependency)
Votes from Connect: 13
Original Date Submitted: 9/21/2011 11:21:52 AM
Description:
Contact Information
Handle: Matthew Reynolds [MSFT]
Site Name: PowerShell
Feedback ID: 689864
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
Problem Description:
Remote registry is a core feature of Windows since before I can remember. IT Pros shouldn't have to resort to external exes, WMI, WinRM or .Net methods to use remote regsitry from powershell. They should be able to script naturally against remote registry.
Providers/cmdlets which interact with registry (e.g., set-item, get-item, etc) should be updated to use remote registry just like they can use remote files via SMB. The underlying .Net classes support it, Windows supports it.
Something like Get-Item \remotemachine\HKLM:\System\Blah
Product Studio item created by Connect Synchronizer due to creation of feedback ID 689864 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=689864).
Repro Steps:
Expected Results:
Internal BugId: 3027

1 comment
-
Shell{&}co commented
Hi
Remote registry can be accessed and changed through Powershell using the Microsoft.Win32.RegistryKey .net class.
An example:
$file = Get-Content c:\temp\hosts.txt
foreach ($computername in $file){
$PingStatus = Gwmi Win32_PingStatus -Filter "Address = '$computername'" | Select-Object StatusCode
If ($PingStatus.StatusCode -eq 0){
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computername )
$regKey= $reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",$true)
$regKey.SetValue("New_Valuename_String","New_Valuedata",[Microsoft.Win32.RegistryValueKind]::String)
}
else {
Write-Host "$computername unreachable"
}
}Script found here : https://www.shellandco.net/change-a-value-in-a-remote-registry/