header1   header
header
header : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
IMPORTANT: PowerShellCommunity.org is moving! - Wednesday, August 15, 2012

PowerShellCommunity.org is moving!  This community software, and the hardware that it sits on, are no longer serving the purposes of this community.  As a result, we have decided to move this community to a new home at PowerShell.org.  PowerShell.org is already up and running with the new community software and in its new location, so please post any new questions that you have on the forums over there instead of posting them on this site.  We've already started getting some great questions from members of the community over there so please, come on over and join us!

While we are going through this transition, this site will remain up for the short term.  New posts may no longer be created on these forums, however replies to existing posts are allowed so that users who posted questions don't have to re-post the same question on the new site.

[UPDATE 28/02/2013] New user registration has been disabled and forums have now been switched to read-only, including for existing posts since all threads that were started should now be completed. If you have a question about content on this site or about PowerShell in general, head over to PowerShell.org and ask it there where there are people actively using the site and answering questions.

If you have any questions, please let us know on the PowerShell.org site.

Thank you,

Kirk "Poshoholic" Munro

 
automate copy of reg keys
Last Post 30 May 2012 06:41 AM by EBGreen. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
kevinyeandelUser is Offline
New Member
New Member
Posts:16
Avatar

--
30 May 2012 04:23 AM
    Hi

    Under location

    HKEY_LOCAL_MACHINE\Software\SimonTatham\PuTTY\SshHostKeys

    is a list of keys starting

    "rsa2@servername"="0x23,0xbde1504518a4d15c1a8a86754043bb9ac54ba89ae17b.....................
    and I need to conditionally copy a key (where servername=host_i_want_a_key_for) to
    HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys

    Previously I would use regedit and export to a .reg file then use notepad to do a S & R then import the keys using regedit again.

    I want to do this with PowerShell, is there an easy way?

    Many thanks in advance.

    Kevin


    EBGreenUser is Offline
    Veteran Member
    Veteran Member
    Posts:1276
    Avatar

    --
    30 May 2012 06:41 AM
    Copy-Item should do it, but I have never used it for copying keys. I don't have time to check it out right now, but if it will work it should be pretty straight forward to suss out.
    "Look Ma...no strings!"
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Many thanks to our original sponsors: Quest Software • SAPIEN Technologies • Compellent • Microsoft footer
    footer   footer