<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Use PowerShell to Edit the Registry on Remote Computers</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/16/use-powershell-to-edit-the-registry-on-remote-computers.aspx</link><description>Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to edit the registry on remote computers.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Use PowerShell to Edit the Registry on Remote Computers</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/16/use-powershell-to-edit-the-registry-on-remote-computers.aspx#3513422</link><pubDate>Thu, 09 Aug 2012 16:43:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3513422</guid><dc:creator>Stanz</dc:creator><description>&lt;p&gt;What if I have to add a key for the current user which is not me? I.E Bill is logged into computer A and I need to add an entry into his HKCU hive. When I enter the pssession with my credentials doesn&amp;#39;t it add the key to my registry hive on the remote computer?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Stanz&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3513422" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Edit the Registry on Remote Computers</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/16/use-powershell-to-edit-the-registry-on-remote-computers.aspx#3487132</link><pubDate>Fri, 16 Mar 2012 17:52:35 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3487132</guid><dc:creator>jrv</dc:creator><description>&lt;p&gt;##Method #1:&lt;/p&gt;
&lt;p&gt;$reg=[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(&amp;#39;currentuser&amp;#39;, $computername)&lt;/p&gt;
&lt;p&gt;$key=$reg.CreateSubKey(&amp;#39;software\hsg&amp;#39;)&lt;/p&gt;
&lt;p&gt;$key.SetValue(&amp;#39;scriptingfun&amp;#39;,&amp;#39;yes it is&amp;#39;)&lt;/p&gt;
&lt;p&gt;$key.Close()&lt;/p&gt;
&lt;p&gt;$reg.Close()&lt;/p&gt;
&lt;p&gt;##Method #2:&lt;/p&gt;
&lt;p&gt;$sb={&lt;/p&gt;
&lt;p&gt; &amp;nbsp; new-item hkcu:\software\hsg&lt;/p&gt;
&lt;p&gt; &amp;nbsp; new-itemproperty -Path hkcu:\software\hsg -Name test -Value 1&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Invoke-Command -ScriptBlock $sb -ComputerName $cpmputer -Credential $cred&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3487132" width="1" height="1"&gt;</description></item></channel></rss>